Class MessageQueueManager

java.lang.Object
java.lang.Thread
org.medcare.igtl.network.MessageQueueManager
All Implemented Interfaces:
Runnable

public class MessageQueueManager extends Thread
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.
  • Constructor Details

    • MessageQueueManager

      public MessageQueueManager(ServerThread serverThread)
      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
      Specified by:
      run in interface Runnable
      Overrides:
      run in class Thread
    • addMessage

      public void addMessage(MessageHandler messageHandler)
      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

      public String getVersion()
      ** Gets the current version return@ The version value
    • setOpenIGT_Queue

      public void setOpenIGT_Queue(ConcurrentLinkedQueue<MessageHandler> openIGT_Queue)
    • getOpenIGT_Queue

      public ConcurrentLinkedQueue<MessageHandler> getOpenIGT_Queue()