Package org.medcare.igtl.network
Class MessageQueueManager
java.lang.Object
java.lang.Thread
org.medcare.igtl.network.MessageQueueManager
- All Implemented Interfaces:
Runnable
One MessageQueueManager is created by each ServerThread to add MessageHandler
to MessageQueueManager queue as soon as they receive messages.
MessageQueueManager will perform MessageHandler respecting the order. Using
eventually ServerThread to send responses to its ServerThread client.
-
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
ConstructorDescriptionMessageQueueManager
(ServerThread serverThread) Default MessageQueueManager constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addMessage
(MessageHandler messageHandler) add a new request to the request 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 and process requests in queuevoid
setOpenIGT_Queue
(ConcurrentLinkedQueue<MessageHandler> openIGT_Queue) void
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
-
Constructor Details
-
MessageQueueManager
Default MessageQueueManager constructor.- Parameters:
serverThread
- to use to send responses to OpenIGTclient
-
-
Method Details
-
run
public void run()Starts the thread and process requests in queue -
addMessage
add a new request to the request queue- Parameters:
messageHandler
-
-
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 -
setOpenIGT_Queue
-
getOpenIGT_Queue
-