Class JmsQueueReader<U extends StatusBean>

java.lang.Object
org.eclipse.scanning.event.JmsQueueReader<U>
All Implemented Interfaces:
AutoCloseable, IConnection, IJmsQueueReader<U>, IURIConnection

public class JmsQueueReader<U extends StatusBean> extends Object implements IJmsQueueReader<U>
  • Field Details

  • Constructor Details

  • Method Details

    • getQueueName

      public String getQueueName()
      Specified by:
      getQueueName in interface IJmsQueueReader<U extends StatusBean>
    • start

      public void start()
      Specified by:
      start in interface IJmsQueueReader<U extends StatusBean>
    • runAndHandleError

      protected void runAndHandleError()
    • run

      public void run() throws EventException
      Specified by:
      run in interface IJmsQueueReader<U extends StatusBean>
      Throws:
      EventException
    • isRunning

      public boolean isRunning()
      Specified by:
      isRunning in interface IJmsQueueReader<U extends StatusBean>
    • stop

      public void stop()
      Specified by:
      stop in interface IJmsQueueReader<U extends StatusBean>
    • disconnect

      public void disconnect() throws EventException
      Description copied from interface: IConnection
      Call to disconnect any resources which we no longer need. The resource may have timed out so it might not be connected, in that case it silently returns. Note, that the method IConnection.close(), inherited from AutoCloseable calls this method, which means that if an object of a class implementing IConnection is used with a try-with-resources block this method will be called automatically when exiting that block.
      Specified by:
      disconnect in interface IConnection
      Throws:
      EventException - if resource could not be disconnected.
    • getConnectorService

      public IEventConnectorService getConnectorService()
      Description copied from interface: IURIConnection
      The underlyng service which the uri is connected using
      Specified by:
      getConnectorService in interface IURIConnection
    • getSession

      protected javax.jms.Session getSession() throws javax.jms.JMSException
      Throws:
      javax.jms.JMSException
    • getQueueSession

      protected javax.jms.QueueSession getQueueSession() throws javax.jms.JMSException
      Throws:
      javax.jms.JMSException
    • createQueue

      protected javax.jms.Queue createQueue(String queueName) throws javax.jms.JMSException
      Creates and returns a queue of the given name
      Parameters:
      queueName -
      Returns:
      Throws:
      javax.jms.JMSException
    • getUri

      public URI getUri()
      Description copied from interface: IURIConnection
      The URI of this connection.
      Specified by:
      getUri in interface IURIConnection
      Returns:
    • getSubmitQueueName

      public String getSubmitQueueName()
    • getStatusTopicName

      public String getStatusTopicName()
    • setStatusTopicName

      public void setStatusTopicName(String statusTopicName)
    • isForSameObject

      protected boolean isForSameObject(Object qbean, Object bean)
      A utility method to test if a bean from the queue represents the same bean as that given . This is done by comparing their uniqueIds, if present, and falls back on using Object.equals(Object)
      Parameters:
      qbean -
      bean -
      Returns:
      true if the two beans represent the same object, false otherwise
    • isConnected

      public boolean isConnected()
      Description copied from interface: IConnection
      Returns whether this connection is connected. This method returns true until disconnect is called, even if the connection is created lazily.
      Specified by:
      isConnected in interface IConnection
      Returns:
      true if connected, false otherwise
    • setConnected

      protected void setConnected(boolean connected)