Interface JmsSupport

All Known Implementing Classes:
AbstractJmsSupport, Jms102bSupport, Jms11Support, Jms20Support, Jms30Support

public interface JmsSupport
JmsSupport is an interface that provides a polymorphic facade to the JMS 1.0.2b, 1.1 and 2.0 API specifications. this interface is not intended for general purpose use and should only be used with the Mule JMS connector.
Since:
1.0
  • Method Summary

    Modifier and Type
    Method
    Description
    jakarta.jms.Connection
    createConnection(jakarta.jms.ConnectionFactory connectionFactory)
    Creates a new Connection
    jakarta.jms.Connection
    createConnection(jakarta.jms.ConnectionFactory connectionFactory, String username, String password)
    Creates a new Connection with custom user/password authentication
    jakarta.jms.MessageConsumer
    createConsumer(jakarta.jms.Session session, jakarta.jms.Destination destination, String messageSelector, ConsumerType type)
    Creates a new JMS MessageConsumer using the given Session
    jakarta.jms.Destination
    createDestination(jakarta.jms.Session session, String name, boolean topic, JmsConfig<?,?> config)
    Creates a new JMS Destination with the given name.
    jakarta.jms.MessageProducer
    createProducer(jakarta.jms.Session session, jakarta.jms.Destination destination, boolean topic)
    Creates a new JMS MessageProducer using the given Session
    jakarta.jms.Session
    createSession(jakarta.jms.Connection connection, boolean topic, boolean transacted, int ackMode)
    Creates a new Session for the given Connection
    jakarta.jms.TemporaryQueue
    createTemporaryDestination(jakarta.jms.Session session)
    Creates an anonymous temporary Queue Destination
    jakarta.jms.XAConnection
    createXaConnection(jakarta.jms.XAConnectionFactory connectionFactory)
    Creates a new XAConnection
    jakarta.jms.XAConnection
    createXaConnection(jakarta.jms.XAConnectionFactory connectionFactory, String username, String password)
    Creates a new XAConnection
    jakarta.jms.XASession
    createXaSession(jakarta.jms.XAConnection connection)
    Creates a new Session for the given Connection
     
    void
    send(jakarta.jms.MessageProducer producer, jakarta.jms.Message message, boolean persistent, int priority, long ttl, boolean topic)
    Sends the given Message to the indicated Destination using the parametrized configurations
    void
    send(jakarta.jms.MessageProducer producer, jakarta.jms.Message message, boolean persistent, int priority, long ttl, boolean topic, jakarta.jms.CompletionListener completionListener)
    Sends the given Message to the indicated Destination using the parametrized configurations in a async way.
  • Method Details

    • createConnection

      jakarta.jms.Connection createConnection(jakarta.jms.ConnectionFactory connectionFactory) throws jakarta.jms.JMSException
      Creates a new Connection
      Parameters:
      connectionFactory - the ConnectionFactory to use for creating the Connection
      Returns:
      a new Connection
      Throws:
      jakarta.jms.JMSException - if an error occurs during connection creation
    • createConnection

      jakarta.jms.Connection createConnection(jakarta.jms.ConnectionFactory connectionFactory, String username, String password) throws jakarta.jms.JMSException
      Creates a new Connection with custom user/password authentication
      Parameters:
      connectionFactory - the ConnectionFactory to use for creating the Connection
      username - the credentials username
      password - the credentials password
      Returns:
      a new Connection
      Throws:
      jakarta.jms.JMSException - if an error occurs during connection creation
    • createXaConnection

      jakarta.jms.XAConnection createXaConnection(jakarta.jms.XAConnectionFactory connectionFactory) throws jakarta.jms.JMSException
      Creates a new XAConnection
      Parameters:
      connectionFactory - the XAConnectionFactory to use for creating the XAConnection
      Returns:
      a new Connection
      Throws:
      jakarta.jms.JMSException - if an error occurs during connection creation
    • createXaConnection

      jakarta.jms.XAConnection createXaConnection(jakarta.jms.XAConnectionFactory connectionFactory, String username, String password) throws jakarta.jms.JMSException
      Creates a new XAConnection
      Parameters:
      connectionFactory - the XAConnectionFactory to use for creating the XAConnection
      Returns:
      a new Connection
      Throws:
      jakarta.jms.JMSException - if an error occurs during connection creation
    • createSession

      jakarta.jms.Session createSession(jakarta.jms.Connection connection, boolean topic, boolean transacted, int ackMode) throws jakarta.jms.JMSException
      Creates a new Session for the given Connection
      Parameters:
      connection - the Connection to use for creating the Session
      topic - if true the Session created will be a TopicSession. This distinction is made only for JmsSpecification.JMS_1_0_2b
      transacted - indicates whether the session will use a local transaction
      ackMode - the Session InternalAckMode
      Returns:
      a new Session
      Throws:
      jakarta.jms.JMSException - if an error occurs during connection creation
    • createXaSession

      jakarta.jms.XASession createXaSession(jakarta.jms.XAConnection connection) throws jakarta.jms.JMSException
      Creates a new Session for the given Connection
      Parameters:
      connection - the XAConnection to use for creating the XASession
      Returns:
      a new XASession
      Throws:
      jakarta.jms.JMSException - if an error occurs during connection creation
    • createDestination

      jakarta.jms.Destination createDestination(jakarta.jms.Session session, String name, boolean topic, JmsConfig<?,?> config) throws jakarta.jms.JMSException, DestinationNotFoundException
      Creates a new JMS Destination with the given name. If LookupJndiDestination.ALWAYS or LookupJndiDestination.TRY_ALWAYS where configured, this name will be used for performing the JNDI lookup
      Parameters:
      session - the Session used to create the Destination
      name - the name of the destination
      topic - if true, a Topic Destination will be created, otherwise the Queue default is used
      Returns:
      a new Destination
      Throws:
      jakarta.jms.JMSException - if an error occurs during the creation of the destination
      DestinationNotFoundException - if LookupJndiDestination.ALWAYS is configured and no Destination with the given name is found
    • createTemporaryDestination

      jakarta.jms.TemporaryQueue createTemporaryDestination(jakarta.jms.Session session) throws jakarta.jms.JMSException
      Creates an anonymous temporary Queue Destination
      Parameters:
      session - the Session used to create the Destination
      Returns:
      a new temporary Queue Destination
      Throws:
      jakarta.jms.JMSException - if an error occurs during destination creation
    • createProducer

      jakarta.jms.MessageProducer createProducer(jakarta.jms.Session session, jakarta.jms.Destination destination, boolean topic) throws jakarta.jms.JMSException
      Creates a new JMS MessageProducer using the given Session
      Parameters:
      session - the Session used to create the MessageProducer
      destination - the Destination to where the Messages will be published
      topic - 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
    • send

      void send(jakarta.jms.MessageProducer producer, jakarta.jms.Message message, boolean persistent, int priority, long ttl, boolean topic) throws jakarta.jms.JMSException
      Sends the given Message to the indicated Destination using the parametrized configurations
      Parameters:
      producer - the MessageProducer to use for sending the message
      message - the Message to send
      persistent - true if DeliveryMode.PERSISTENT should be used
      priority - the Message.getJMSPriority() to be set on send
      ttl - the message's lifetime (in milliseconds)
      topic - used by JmsSpecification.JMS_1_0_2b to decide whether to use the MessageProducer as TopicPublisher or a QueueSender
      Throws:
      jakarta.jms.JMSException - if an error occurs during messsage sending
    • send

      void send(jakarta.jms.MessageProducer producer, jakarta.jms.Message message, boolean persistent, int priority, long ttl, boolean topic, jakarta.jms.CompletionListener completionListener) throws jakarta.jms.JMSException
      Sends the given Message to the indicated Destination using the parametrized configurations in a async way.
      Parameters:
      producer - the MessageProducer to use for sending the message
      message - the Message to send
      persistent - true if DeliveryMode.PERSISTENT should be used
      priority - the Message.getJMSPriority() to be set on send
      ttl - the message's lifetime (in milliseconds)
      topic - used by JmsSpecification.JMS_1_0_2b to decide whether to use the MessageProducer as TopicPublisher or a QueueSender
      Throws:
      jakarta.jms.JMSException - if an error occurs during messsage sending
    • createConsumer

      jakarta.jms.MessageConsumer createConsumer(jakarta.jms.Session session, jakarta.jms.Destination destination, String messageSelector, ConsumerType type) throws jakarta.jms.JMSException
      Creates a new JMS MessageConsumer using the given Session
      Parameters:
      session - the Session used to create the MessageConsumer
      destination - the Destination from which Messages will be consumed
      messageSelector - a JMS selector string for filtering incoming Messages. Empty or null implies no filtering
      type - 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
    • getSpecification

      JmsSpecification getSpecification()
      Returns:
      this implementation JmsSpecification