Class JmsConnection

java.lang.Object
com.northconcepts.datapipeline.core.DataObject
com.northconcepts.datapipeline.jms.JmsConnection

public class JmsConnection extends DataObject
A connection to Java Message Service (JMS) provider.
  • Constructor Details

    • JmsConnection

      public JmsConnection(JmsSettings settings)
  • Method Details

    • getConnection

      public Connection getConnection()
      Returns the underlying JMS connection or null before open() is called.
    • getSession

      public Session getSession()
      Returns the JMS session or null before open() is called.
    • getDestination

      public Destination getDestination()
      Returns the queue or topic named in the settings or null before open() is called.
    • open

      public void open() throws DataException
      Connects using the connection factory looked up through JNDI with the settings' properties and creates the session and destination; call start() afterwards to begin receiving messages.
      Throws:
      DataException
    • close

      public void close() throws DataException
      Throws:
      DataException
    • addExceptionProperties

      public DataException addExceptionProperties(DataException exception)
      Description copied from class: DataObject
      Adds this object's current state to a DataException. Since this method is called whenever an exception is thrown, subclasses should override it to add their specific information.
      Overrides:
      addExceptionProperties in class DataObject
    • start

      public void start() throws Throwable
      Starts the connection so messages can be received; only valid after open().
      Throws:
      Throwable
    • stop

      public void stop() throws Throwable
      Stops the connection, first unsubscribing the durable subscription named by the settings' client ID if one is set.
      Throws:
      Throwable