Class JmsConnection

java.lang.Object
org.mule.jms.commons.internal.connection.JmsConnection
All Implemented Interfaces:
org.mule.runtime.api.lifecycle.Disposable, org.mule.runtime.api.lifecycle.Stoppable
Direct Known Subclasses:
JmsTransactionalConnection

public class JmsConnection extends Object implements org.mule.runtime.api.lifecycle.Stoppable, org.mule.runtime.api.lifecycle.Disposable
A Connection for the JmsConnector
Since:
1.0
  • Constructor Details

  • Method Details

    • getJmsSupport

      public JmsSupport getJmsSupport()
    • get

      public jakarta.jms.Connection get()
    • setConnection

      public void setConnection(jakarta.jms.Connection connection)
    • createSession

      public JmsSession createSession(InternalAckMode ackMode, boolean isTopic) throws jakarta.jms.JMSException
      Creates a new JMS Session using the current Connection
      Parameters:
      ackMode - the Session InternalAckMode
      isTopic - if true the Session created will be a TopicSession. This distinction is made only for JmsSpecification.JMS_1_0_2b]
      Returns:
      a new Session
      Throws:
      jakarta.jms.JMSException - if an error occurs while creating the Session
    • createConsumer

      public JmsMessageConsumer createConsumer(JmsSession session, jakarta.jms.Destination jmsDestination, String selector, ConsumerType consumerType, boolean avoidCaching) throws jakarta.jms.JMSException
      Creates a new JMS MessageConsumer using the given Session
      Parameters:
      session - the JmsSession used to create the MessageConsumer
      jmsDestination - the Destination from which Messages will be consumed
      selector - a JMS selector string for filtering incoming Messages. Empty or null implies no filtering
      consumerType - the ConsumerType to use based on the Destination type
      avoidCaching - indicates if the consumer should prevent be cached.
      Returns:
      a new MessageConsumer for the given Destination
      Throws:
      jakarta.jms.JMSException - if an error occurs while creating the consumer
    • createConsumer

      public JmsMessageConsumer createConsumer(JmsSession session, jakarta.jms.Destination jmsDestination, String selector, ConsumerType consumerType) throws jakarta.jms.JMSException
      Creates a new JMS MessageConsumer using the given Session
      Parameters:
      session - the JmsSession used to create the MessageConsumer
      jmsDestination - the Destination from which Messages will be consumed
      selector - a JMS selector string for filtering incoming Messages. Empty or null implies no filtering
      consumerType - the ConsumerType to use based on the Destination type
      Returns:
      a new MessageConsumer for the given Destination
      Throws:
      jakarta.jms.JMSException - if an error occurs while creating the consumer
    • createProducer

      public JmsMessageProducer createProducer(JmsSession session, jakarta.jms.Destination jmsDestination, boolean isTopic) throws jakarta.jms.JMSException
      Creates a new JMS MessageProducer using the given Session
      Parameters:
      session - the JmsSession used to create the MessageProducer
      jmsDestination - the Destination to where the Messages will be published
      isTopic - if true the given Destination has a Topic destination type. This distinction is made only for JmsSpecification.JMS_1_0_2b in order to decide whether to create a TopicPublisher or a QueueSender
      Returns:
      a new MessageProducer for the given Destination
      Throws:
      jakarta.jms.JMSException - if an error occurs while creating the consumer
    • stop

      public void stop() throws org.mule.runtime.api.exception.MuleException
      Temporarily stops a connection's delivery of incoming messages. Delivery can be restarted using the connection's start method. When the connection is stopped, delivery to all the connection's message consumers is inhibited.
      Specified by:
      stop in interface org.mule.runtime.api.lifecycle.Stoppable
      Throws:
      org.mule.runtime.api.exception.MuleException
    • dispose

      public void dispose()
      Specified by:
      dispose in interface org.mule.runtime.api.lifecycle.Disposable
    • registerExceptionListener

      public void registerExceptionListener(jakarta.jms.ExceptionListener exceptionListener)
    • removeExceptionListener

      public void removeExceptionListener(jakarta.jms.ExceptionListener exceptionListener)
    • getJmsSessionManager

      public JmsSessionManager getJmsSessionManager()