Class JCACommandThread
java.lang.Object
java.lang.Thread
org.epics.archiverappliance.engine.pv.JCACommandThread
- All Implemented Interfaces:
Runnable
- Version:
- Initial version:CSS, 4-Jun-2012, Luofeng Li:added codes to support for the new archiver
- Author:
- Kay Kasemir
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.Builder, Thread.State, Thread.UncaughtExceptionHandler -
Field Summary
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY -
Constructor Summary
ConstructorsConstructorDescriptionJCACommandThread(int commandThreadId) Construct, but don't start the thread. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCommand(Runnable command) Add a command to the queue.gov.aps.jca.ChannelcreateChannel(String name, gov.aps.jca.event.ConnectionListener conn_callback) booleandoesChannelContextMatchThreadContext(gov.aps.jca.Channel channel) List<gov.aps.jca.Channel> getAllChannelsForPV(String pvNameOnly) intintbooleanvoidrun()voidshutdown()Stop the thread and wait for it to finishvoidstart()Version ofstartthat may be called multiple times.Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, isVirtual, join, join, join, join, ofPlatform, ofVirtual, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, sleep, startVirtualThread, stop, suspend, threadId, toString, yield
-
Constructor Details
-
JCACommandThread
Construct, but don't start the thread.- Throws:
ConfigException- See Also:
-
-
Method Details
-
start
public void start()Version ofstartthat may be called multiple times.The thread must only be started after the first PV has been created. Otherwise, if flush is called without PVs, JNI JCA reports pthread errors.
NOP when already running
-
shutdown
Stop the thread and wait for it to finish- Throws:
InterruptedException-
-
createChannel
public gov.aps.jca.Channel createChannel(String name, gov.aps.jca.event.ConnectionListener conn_callback) throws IllegalStateException, gov.aps.jca.CAException - Throws:
IllegalStateExceptiongov.aps.jca.CAException
-
hasContextBeenInitialized
public boolean hasContextBeenInitialized() -
doesChannelContextMatchThreadContext
public boolean doesChannelContextMatchThreadContext(gov.aps.jca.Channel channel) -
getAllChannelsForPV
-
getTotalChannelCount
public int getTotalChannelCount() -
getChannelsWithPendingSearchRequests
public int getChannelsWithPendingSearchRequests() -
addCommand
Add a command to the queue. add some cap on the command queue? At least for value updates?- Parameters:
command- Runnable
-
run
public void run() -
getCommandThreadDetails
-