Class Jms102bSupport
java.lang.Object
org.mule.jms.commons.internal.support.AbstractJmsSupport
org.mule.jms.commons.internal.support.Jms20Support
org.mule.jms.commons.internal.support.Jms11Support
org.mule.jms.commons.internal.support.Jms102bSupport
- All Implemented Interfaces:
JmsSupport
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
ConstructorsConstructorDescriptionJms102bSupport(LookupJndiDestination lookupJndiDestination, Function<String, Optional<jakarta.jms.Destination>> jndiObjectSupplier) -
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 dest, 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.Methods inherited from class org.mule.jms.commons.internal.support.AbstractJmsSupport
createDestinationFromJndi, getJndiDestination, getLookupJndiDestination
-
Constructor Details
-
Jms102bSupport
public Jms102bSupport() -
Jms102bSupport
public Jms102bSupport(LookupJndiDestination lookupJndiDestination, Function<String, Optional<jakarta.jms.Destination>> jndiObjectSupplier)
-
-
Method Details
-
getSpecification
- Specified by:
getSpecificationin interfaceJmsSupport- Overrides:
getSpecificationin classJms11Support- Returns:
thisimplementationJmsSpecification
-
createConnection
public jakarta.jms.Connection createConnection(jakarta.jms.ConnectionFactory connectionFactory, String username, String password) throws jakarta.jms.JMSException Creates a newConnectionwith custom user/password authentication- Specified by:
createConnectionin interfaceJmsSupport- Overrides:
createConnectionin classAbstractJmsSupport- 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
-
createConnection
public jakarta.jms.Connection createConnection(jakarta.jms.ConnectionFactory connectionFactory) throws jakarta.jms.JMSException Creates a newConnection- Specified by:
createConnectionin interfaceJmsSupport- Overrides:
createConnectionin classAbstractJmsSupport- Parameters:
connectionFactory- theConnectionFactoryto use for creating theConnection- 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:JmsSupportCreates a newXAConnection- Specified by:
createXaConnectionin interfaceJmsSupport- Overrides:
createXaConnectionin classAbstractJmsSupport- Parameters:
connectionFactory- theXAConnectionFactoryto use for creating theXAConnection- 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:JmsSupportCreates a newXAConnection- Specified by:
createXaConnectionin interfaceJmsSupport- Overrides:
createXaConnectionin classAbstractJmsSupport- Parameters:
connectionFactory- theXAConnectionFactoryto use for creating theXAConnection- 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 newSessionfor the givenConnection- Specified by:
createSessionin interfaceJmsSupport- Overrides:
createSessionin classAbstractJmsSupport- 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
public jakarta.jms.XASession createXaSession(jakarta.jms.XAConnection connection) throws jakarta.jms.JMSException Description copied from interface:JmsSupportCreates a newSessionfor the givenConnection- Specified by:
createXaSessionin interfaceJmsSupport- Overrides:
createXaSessionin classAbstractJmsSupport- Parameters:
connection- theXAConnectionto use for creating theXASession- 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 JMSMessageConsumerusing the givenSession- Specified by:
createConsumerin interfaceJmsSupport- Overrides:
createConsumerin classJms11Support- 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
-
createProducer
public jakarta.jms.MessageProducer createProducer(jakarta.jms.Session session, jakarta.jms.Destination dest, boolean topic) throws jakarta.jms.JMSException Creates a new JMSMessageProducerusing the givenSession- Specified by:
createProducerin interfaceJmsSupport- Overrides:
createProducerin classAbstractJmsSupport- Parameters:
session- theSessionused to create theMessageProducerdest- 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
-
createDestination
public jakarta.jms.Destination createDestination(jakarta.jms.Session session, String name, boolean topic, JmsConfig<?, ?> config) throws jakarta.jms.JMSExceptionCreates a new JMSDestinationwith the givenname. IfLookupJndiDestination.ALWAYSorLookupJndiDestination.TRY_ALWAYSwhere configured, thisnamewill be used for performing the JNDI lookup- Specified by:
createDestinationin interfaceJmsSupport- Overrides:
createDestinationin classAbstractJmsSupport- 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 destination
-
createTemporaryDestination
public jakarta.jms.TemporaryQueue createTemporaryDestination(jakarta.jms.Session session) throws jakarta.jms.JMSException Creates an anonymous temporaryQueueDestination- Specified by:
createTemporaryDestinationin interfaceJmsSupport- Overrides:
createTemporaryDestinationin classAbstractJmsSupport- Parameters:
session- theSessionused to create theDestination- Returns:
- a new temporary
QueueDestination - 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 givenMessageto the indicatedDestinationusing the parametrized configurations- Specified by:
sendin interfaceJmsSupport- Overrides:
sendin classAbstractJmsSupport- 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
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 givenMessageto the indicatedDestinationusing 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:
sendin interfaceJmsSupport- Overrides:
sendin classJms11Support- 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
-