Package org.medcare.igtl.network
Class ResponseQueueManager
java.lang.Object
java.lang.Thread
org.medcare.igtl.network.ResponseQueueManager
- All Implemented Interfaces:
Runnable
Each OpenIGTClient create its own ResponseQueueManager to queue response they
get from server. ResponseQueueManager will perform ResponseHandler added in
them queue respecting the order.
User must adapt Capability enum, to be able to send the right capability list and to have a correct error management for incorrect capability request
-
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
ConstructorDescriptionResponseQueueManager
(ErrorManager errorManager) Default ResponseQueueManager constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addResponse
(ResponseHandler responseHandler) add a new response to the response queuevoid
destroy()
stop the threadlong
** Gets the current sleep time value return@ The sleep time value** Gets the current version return@ The version valuevoid
run()
Starts the thread reading responses and adding them to the responseQueuevoid
setSleepTime
(long sleep) Sets the time the listener thread will wait between actionsMethods 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, start, startVirtualThread, stop, suspend, threadId, toString, yield
-
Field Details
-
openIGT_Queue
-
-
Constructor Details
-
ResponseQueueManager
Default ResponseQueueManager constructor.- Parameters:
errorManager
-
-
-
Method Details
-
run
public void run()Starts the thread reading responses and adding them to the responseQueue -
addResponse
add a new response to the response queue- Parameters:
responseHandler
- created by OpenIGTClient when receiving a message
-
destroy
public void destroy()stop the thread -
getSleepTime
public long getSleepTime()** Gets the current sleep time value return@ The sleep time value -
setSleepTime
public void setSleepTime(long sleep) Sets the time the listener thread will wait between actions- Parameters:
sleep
-
-
getVersion
** Gets the current version return@ The version value
-