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 TypeMethodDescriptionjakarta.jms.ConnectioncreateConnection(jakarta.jms.ConnectionFactory connectionFactory) Creates a newConnectionjakarta.jms.ConnectioncreateConnection(jakarta.jms.ConnectionFactory connectionFactory, String username, String password) Creates a newConnectionwith custom user/password authenticationjakarta.jms.MessageConsumercreateConsumer(jakarta.jms.Session session, jakarta.jms.Destination destination, String messageSelector, ConsumerType type) Creates a new JMSMessageConsumerusing the givenSessionjakarta.jms.DestinationcreateDestination(jakarta.jms.Session session, String name, boolean topic, JmsConfig<?, ?> config) Creates a new JMSDestinationwith the givenname.jakarta.jms.MessageProducercreateProducer(jakarta.jms.Session session, jakarta.jms.Destination destination, boolean topic) Creates a new JMSMessageProducerusing the givenSessionjakarta.jms.SessioncreateSession(jakarta.jms.Connection connection, boolean topic, boolean transacted, int ackMode) Creates a newSessionfor the givenConnectionjakarta.jms.TemporaryQueuecreateTemporaryDestination(jakarta.jms.Session session) Creates an anonymous temporaryQueueDestinationjakarta.jms.XAConnectioncreateXaConnection(jakarta.jms.XAConnectionFactory connectionFactory) Creates a newXAConnectionjakarta.jms.XAConnectioncreateXaConnection(jakarta.jms.XAConnectionFactory connectionFactory, String username, String password) Creates a newXAConnectionjakarta.jms.XASessioncreateXaSession(jakarta.jms.XAConnection connection) Creates a newSessionfor the givenConnectionvoidsend(jakarta.jms.MessageProducer producer, jakarta.jms.Message message, boolean persistent, int priority, long ttl, boolean topic) Sends the givenMessageto the indicatedDestinationusing the parametrized configurationsvoidsend(jakarta.jms.MessageProducer producer, jakarta.jms.Message message, boolean persistent, int priority, long ttl, boolean topic, jakarta.jms.CompletionListener completionListener) Sends the givenMessageto the indicatedDestinationusing the parametrized configurations in a async way.
-
Method Details
-
createConnection
jakarta.jms.Connection createConnection(jakarta.jms.ConnectionFactory connectionFactory) throws jakarta.jms.JMSException Creates a newConnection- Parameters:
connectionFactory- theConnectionFactoryto use for creating theConnection- 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 newConnectionwith custom user/password authentication- Parameters:
connectionFactory- theConnectionFactoryto use for creating theConnectionusername- the credentials usernamepassword- 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 newXAConnection- Parameters:
connectionFactory- theXAConnectionFactoryto use for creating theXAConnection- 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 newXAConnection- Parameters:
connectionFactory- theXAConnectionFactoryto use for creating theXAConnection- 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 newSessionfor the givenConnection- Parameters:
connection- theConnectionto use for creating theSessiontopic- iftruetheSessioncreated will be aTopicSession. This distinction is made only forJmsSpecification.JMS_1_0_2btransacted- indicates whether the session will use a local transactionackMode- theSessionInternalAckMode- 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 newSessionfor the givenConnection- Parameters:
connection- theXAConnectionto use for creating theXASession- 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, DestinationNotFoundExceptionCreates a new JMSDestinationwith the givenname. IfLookupJndiDestination.ALWAYSorLookupJndiDestination.TRY_ALWAYSwhere configured, thisnamewill be used for performing the JNDI lookup- Parameters:
session- theSessionused to create theDestinationname- the name of the destinationtopic- iftrue, aTopicDestinationwill be created, otherwise theQueuedefault is used- Returns:
- a new
Destination - Throws:
jakarta.jms.JMSException- if an error occurs during the creation of the destinationDestinationNotFoundException- ifLookupJndiDestination.ALWAYSis configured and noDestinationwith the givennameis found
-
createTemporaryDestination
jakarta.jms.TemporaryQueue createTemporaryDestination(jakarta.jms.Session session) throws jakarta.jms.JMSException Creates an anonymous temporaryQueueDestination- Parameters:
session- theSessionused to create theDestination- Returns:
- a new temporary
QueueDestination - 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 JMSMessageProducerusing the givenSession- Parameters:
session- theSessionused to create theMessageProducerdestination- theDestinationto where theMessages will be publishedtopic- iftruethe givenDestinationhas aTopicdestination type. This distinction is made only forJmsSpecification.JMS_1_0_2bin order to decide whether to create aTopicPublisheror aQueueSender- Returns:
- a new
MessageProducerfor the givenDestination - 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 givenMessageto the indicatedDestinationusing the parametrized configurations- Parameters:
producer- theMessageProducerto use for sending the messagemessage- theMessageto sendpersistent-trueifDeliveryMode.PERSISTENTshould be usedpriority- theMessage.getJMSPriority()to be set on sendttl- the message's lifetime (in milliseconds)topic- used byJmsSpecification.JMS_1_0_2bto decide whether to use theMessageProducerasTopicPublisheror aQueueSender- 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 givenMessageto the indicatedDestinationusing the parametrized configurations in a async way.- Parameters:
producer- theMessageProducerto use for sending the messagemessage- theMessageto sendpersistent-trueifDeliveryMode.PERSISTENTshould be usedpriority- theMessage.getJMSPriority()to be set on sendttl- the message's lifetime (in milliseconds)topic- used byJmsSpecification.JMS_1_0_2bto decide whether to use theMessageProducerasTopicPublisheror aQueueSender- 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 JMSMessageConsumerusing the givenSession- Parameters:
session- theSessionused to create theMessageConsumerdestination- theDestinationfrom whichMessages will be consumedmessageSelector- a JMS selector string for filtering incomingMessages. Empty ornullimplies no filteringtype- theConsumerTypeto use based on theDestinationtype- Returns:
- a new
MessageConsumerfor the givenDestination - Throws:
jakarta.jms.JMSException- if an error occurs while creating the consumer
-
getSpecification
JmsSpecification getSpecification()- Returns:
thisimplementationJmsSpecification
-