Class Jms102bSupport

All Implemented Interfaces:
JmsSupport

public class Jms102bSupport extends Jms11Support
Jms102bSupport is a template class to provide an abstraction to to the Jms 1.0.2b api specification.
Since:
1.0
  • Field Summary

    Fields inherited from class org.mule.jms.commons.internal.support.AbstractJmsSupport

    logger
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    Jms102bSupport(LookupJndiDestination lookupJndiDestination, Function<String,Optional<jakarta.jms.Destination>> jndiObjectSupplier)
     
  • 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 dest, 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.

    Methods inherited from class org.mule.jms.commons.internal.support.AbstractJmsSupport

    createDestinationFromJndi, getJndiDestination, getLookupJndiDestination

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • getSpecification

      public JmsSpecification getSpecification()
      Specified by:
      getSpecification in interface JmsSupport
      Overrides:
      getSpecification in class Jms11Support
      Returns:
      this implementation JmsSpecification
    • createConnection

      public 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
      Specified by:
      createConnection in interface JmsSupport
      Overrides:
      createConnection in class AbstractJmsSupport
      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
    • createConnection

      public jakarta.jms.Connection createConnection(jakarta.jms.ConnectionFactory connectionFactory) throws jakarta.jms.JMSException
      Creates a new Connection
      Specified by:
      createConnection in interface JmsSupport
      Overrides:
      createConnection in class AbstractJmsSupport
      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
    • createXaConnection

      public jakarta.jms.XAConnection createXaConnection(jakarta.jms.XAConnectionFactory connectionFactory) throws jakarta.jms.JMSException
      Description copied from interface: JmsSupport
      Creates a new XAConnection
      Specified by:
      createXaConnection in interface JmsSupport
      Overrides:
      createXaConnection in class AbstractJmsSupport
      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

      public jakarta.jms.XAConnection createXaConnection(jakarta.jms.XAConnectionFactory connectionFactory, String username, String password) throws jakarta.jms.JMSException
      Description copied from interface: JmsSupport
      Creates a new XAConnection
      Specified by:
      createXaConnection in interface JmsSupport
      Overrides:
      createXaConnection in class AbstractJmsSupport
      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

      public 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
      Specified by:
      createSession in interface JmsSupport
      Overrides:
      createSession in class AbstractJmsSupport
      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

      public jakarta.jms.XASession createXaSession(jakarta.jms.XAConnection connection) throws jakarta.jms.JMSException
      Description copied from interface: JmsSupport
      Creates a new Session for the given Connection
      Specified by:
      createXaSession in interface JmsSupport
      Overrides:
      createXaSession in class AbstractJmsSupport
      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
    • createConsumer

      public 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
      Specified by:
      createConsumer in interface JmsSupport
      Overrides:
      createConsumer in class Jms11Support
      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
    • createProducer

      public jakarta.jms.MessageProducer createProducer(jakarta.jms.Session session, jakarta.jms.Destination dest, boolean topic) throws jakarta.jms.JMSException
      Creates a new JMS MessageProducer using the given Session
      Specified by:
      createProducer in interface JmsSupport
      Overrides:
      createProducer in class AbstractJmsSupport
      Parameters:
      session - the Session used to create the MessageProducer
      dest - 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
    • createDestination

      public jakarta.jms.Destination createDestination(jakarta.jms.Session session, String name, boolean topic, JmsConfig<?,?> config) throws jakarta.jms.JMSException
      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
      Specified by:
      createDestination in interface JmsSupport
      Overrides:
      createDestination in class AbstractJmsSupport
      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
    • createTemporaryDestination

      public jakarta.jms.TemporaryQueue createTemporaryDestination(jakarta.jms.Session session) throws jakarta.jms.JMSException
      Creates an anonymous temporary Queue Destination
      Specified by:
      createTemporaryDestination in interface JmsSupport
      Overrides:
      createTemporaryDestination in class AbstractJmsSupport
      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
    • send

      public 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
      Specified by:
      send in interface JmsSupport
      Overrides:
      send in class AbstractJmsSupport
      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

      public 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. Because of async publishing didn't exist on JMS 1.1 or prior. This method will be blocking and sync.
      Specified by:
      send in interface JmsSupport
      Overrides:
      send in class Jms11Support
      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