public class Jms102bSupport extends Jms11Support
Jms102bSupport is a template class to provide an abstraction
to to the Jms 1.0.2b api specification.| Constructor and Description |
|---|
Jms102bSupport() |
Jms102bSupport(LookupJndiDestination lookupJndiDestination,
Function<String,Optional<javax.jms.Destination>> jndiObjectSupplier) |
| Modifier and Type | Method and Description |
|---|---|
javax.jms.Connection |
createConnection(javax.jms.ConnectionFactory connectionFactory)
Creates a new
Connection |
javax.jms.Connection |
createConnection(javax.jms.ConnectionFactory connectionFactory,
String username,
String password)
Creates a new
Connection with custom user/password authentication |
javax.jms.MessageConsumer |
createConsumer(javax.jms.Session session,
javax.jms.Destination destination,
String messageSelector,
ConsumerType type)
Creates a new JMS
MessageConsumer using the given Session |
javax.jms.Destination |
createDestination(javax.jms.Session session,
String name,
boolean topic,
JmsConfig config)
Creates a new JMS
Destination with the given name. |
javax.jms.MessageProducer |
createProducer(javax.jms.Session session,
javax.jms.Destination dest,
boolean topic)
Creates a new JMS
MessageProducer using the given Session |
javax.jms.Session |
createSession(javax.jms.Connection connection,
boolean topic,
boolean transacted,
int ackMode)
Creates a new
Session for the given Connection |
javax.jms.TemporaryQueue |
createTemporaryDestination(javax.jms.Session session)
Creates an anonymous temporary
Queue Destination |
javax.jms.XAConnection |
createXaConnection(javax.jms.XAConnectionFactory connectionFactory)
Creates a new
XAConnection |
javax.jms.XAConnection |
createXaConnection(javax.jms.XAConnectionFactory connectionFactory,
String username,
String password)
Creates a new
XAConnection |
javax.jms.XASession |
createXaSession(javax.jms.XAConnection connection)
Creates a new
Session for the given Connection |
JmsSpecification |
getSpecification() |
void |
send(javax.jms.MessageProducer producer,
javax.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(javax.jms.MessageProducer producer,
javax.jms.Message message,
boolean persistent,
int priority,
long ttl,
boolean topic,
javax.jms.CompletionListener completionListener)
Sends the given
Message to the indicated Destination using the parametrized configurations. |
createDestinationFromJndi, getJndiDestination, getLookupJndiDestinationpublic Jms102bSupport()
public Jms102bSupport(LookupJndiDestination lookupJndiDestination, Function<String,Optional<javax.jms.Destination>> jndiObjectSupplier)
public JmsSpecification getSpecification()
getSpecification in interface JmsSupportgetSpecification in class Jms11Supportthis implementation JmsSpecificationpublic javax.jms.Connection createConnection(javax.jms.ConnectionFactory connectionFactory,
String username,
String password)
throws javax.jms.JMSException
Connection with custom user/password authenticationcreateConnection in interface JmsSupportcreateConnection in class Jms20SupportconnectionFactory - the ConnectionFactory to use for creating the Connectionusername - the credentials usernamepassword - the credentials passwordConnectionjavax.jms.JMSException - if an error occurs during connection creationpublic javax.jms.Connection createConnection(javax.jms.ConnectionFactory connectionFactory)
throws javax.jms.JMSException
ConnectioncreateConnection in interface JmsSupportcreateConnection in class Jms20SupportconnectionFactory - the ConnectionFactory to use for creating the ConnectionConnectionjavax.jms.JMSException - if an error occurs during connection creationpublic javax.jms.XAConnection createXaConnection(javax.jms.XAConnectionFactory connectionFactory)
throws javax.jms.JMSException
Jms20SupportXAConnectioncreateXaConnection in interface JmsSupportcreateXaConnection in class Jms20SupportconnectionFactory - the XAConnectionFactory to use for creating the XAConnectionConnectionjavax.jms.JMSException - if an error occurs during connection creationpublic javax.jms.XAConnection createXaConnection(javax.jms.XAConnectionFactory connectionFactory,
String username,
String password)
throws javax.jms.JMSException
Jms20SupportXAConnectioncreateXaConnection in interface JmsSupportcreateXaConnection in class Jms20SupportconnectionFactory - the XAConnectionFactory to use for creating the XAConnectionConnectionjavax.jms.JMSException - if an error occurs during connection creationpublic javax.jms.Session createSession(javax.jms.Connection connection,
boolean topic,
boolean transacted,
int ackMode)
throws javax.jms.JMSException
Session for the given ConnectioncreateSession in interface JmsSupportcreateSession in class Jms20Supportconnection - the Connection to use for creating the Sessiontopic - if true the Session created will be a TopicSession.
This distinction is made only for JmsSpecification.JMS_1_0_2btransacted - indicates whether the session will use a local transactionackMode - the Session InternalAckModeSessionjavax.jms.JMSException - if an error occurs during connection creationpublic javax.jms.XASession createXaSession(javax.jms.XAConnection connection)
throws javax.jms.JMSException
JmsSupportSession for the given ConnectioncreateXaSession in interface JmsSupportcreateXaSession in class Jms20Supportconnection - the XAConnection to use for creating the XASessionXASessionjavax.jms.JMSException - if an error occurs during connection creationpublic javax.jms.MessageConsumer createConsumer(javax.jms.Session session,
javax.jms.Destination destination,
String messageSelector,
ConsumerType type)
throws javax.jms.JMSException
MessageConsumer using the given SessioncreateConsumer in interface JmsSupportcreateConsumer in class Jms11Supportsession - the Session used to create the MessageConsumerdestination - the Destination from which Messages will be consumedmessageSelector - a JMS selector string for filtering incoming Messages. Empty or null implies no filteringtype - the ConsumerType to use based on the Destination typeMessageConsumer for the given Destinationjavax.jms.JMSException - if an error occurs while creating the consumerpublic javax.jms.MessageProducer createProducer(javax.jms.Session session,
javax.jms.Destination dest,
boolean topic)
throws javax.jms.JMSException
MessageProducer using the given SessioncreateProducer in interface JmsSupportcreateProducer in class Jms20Supportsession - the Session used to create the MessageProducerdest - the Destination to where the Messages will be publishedtopic - 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 QueueSenderMessageProducer for the given Destinationjavax.jms.JMSException - if an error occurs while creating the consumerpublic javax.jms.Destination createDestination(javax.jms.Session session,
String name,
boolean topic,
JmsConfig config)
throws javax.jms.JMSException
Destination with the given name.
If LookupJndiDestination.ALWAYS or LookupJndiDestination.TRY_ALWAYS where configured,
this name will be used for performing the JNDI lookupcreateDestination in interface JmsSupportcreateDestination in class Jms20Supportsession - the Session used to create the Destinationname - the name of the destinationtopic - if true, a Topic Destination will be created,
otherwise the Queue default is usedDestinationjavax.jms.JMSException - if an error occurs during the creation of the destinationpublic javax.jms.TemporaryQueue createTemporaryDestination(javax.jms.Session session)
throws javax.jms.JMSException
Queue DestinationcreateTemporaryDestination in interface JmsSupportcreateTemporaryDestination in class Jms20Supportsession - the Session used to create the DestinationQueue Destinationjavax.jms.JMSException - if an error occurs during destination creationpublic void send(javax.jms.MessageProducer producer,
javax.jms.Message message,
boolean persistent,
int priority,
long ttl,
boolean topic)
throws javax.jms.JMSException
Message to the indicated Destination using the parametrized configurationssend in interface JmsSupportsend in class Jms20Supportproducer - the MessageProducer to use for sending the messagemessage - the Message to sendpersistent - true if DeliveryMode.PERSISTENT should be usedpriority - the Message.getJMSPriority() to be set on sendttl - 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 QueueSenderjavax.jms.JMSException - if an error occurs during messsage sendingpublic void send(javax.jms.MessageProducer producer,
javax.jms.Message message,
boolean persistent,
int priority,
long ttl,
boolean topic,
javax.jms.CompletionListener completionListener)
throws javax.jms.JMSException
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.send in interface JmsSupportsend in class Jms11Supportproducer - the MessageProducer to use for sending the messagemessage - the Message to sendpersistent - true if DeliveryMode.PERSISTENT should be usedpriority - the Message.getJMSPriority() to be set on sendttl - 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 QueueSenderjavax.jms.JMSException - if an error occurs during messsage sendingCopyright © 2019. All rights reserved.