public final class JmsConnection extends Object implements org.mule.runtime.api.lifecycle.Stoppable, org.mule.runtime.api.lifecycle.Disposable
| Constructor and Description |
|---|
JmsConnection(JmsSupport jmsSupport,
javax.jms.Connection connection) |
| Modifier and Type | Method and Description |
|---|---|
JmsMessageConsumer |
createConsumer(javax.jms.Session session,
javax.jms.Destination jmsDestination,
String selector,
ConsumerType consumerType)
Creates a new JMS
MessageConsumer using the given Session |
JmsMessageProducer |
createProducer(javax.jms.Session session,
javax.jms.Destination jmsDestination,
boolean isTopic)
Creates a new JMS
MessageProducer using the given Session |
JmsSession |
createSession(AckMode ackMode,
boolean isTopic)
Creates a new JMS
Session using the current Connection |
void |
dispose() |
void |
doAck(String ackId)
Executes the
Message.acknowledge() on the latest Message associated to the Session
identified by the ackId |
javax.jms.Connection |
get() |
JmsSupport |
getJmsSupport() |
void |
registerMessageForAck(String ackId,
javax.jms.Message message)
Registers the
Message to the Session using the ackId in order to being
able later to perform a AckMode.MANUAL ACK |
void |
releaseResources()
Release the resources related to the Session, Producers and Consumers that
may have been allocated by this Connection.
|
void |
stop()
Temporarily stops a connection's delivery of incoming messages.
|
public JmsConnection(JmsSupport jmsSupport, javax.jms.Connection connection)
public JmsSupport getJmsSupport()
public javax.jms.Connection get()
public JmsSession createSession(AckMode ackMode, boolean isTopic) throws javax.jms.JMSException
Session using the current ConnectionackMode - the Session AckModeisTopic - if true the Session created will be a TopicSession.
This distinction is made only for JmsSpecification.JMS_1_0_2bSessionjavax.jms.JMSException - if an error occurs while creating the Sessionpublic JmsMessageConsumer createConsumer(javax.jms.Session session, javax.jms.Destination jmsDestination, String selector, ConsumerType consumerType) throws javax.jms.JMSException
MessageConsumer using the given Sessionsession - the Session used to create the MessageConsumerjmsDestination - the Destination from which Messages will be consumedselector - a JMS selector string for filtering incoming Messages. Empty or null implies no filteringconsumerType - the ConsumerType to use based on the Destination typeMessageConsumer for the given Destinationjavax.jms.JMSException - if an error occurs while creating the consumerpublic JmsMessageProducer createProducer(javax.jms.Session session, javax.jms.Destination jmsDestination, boolean isTopic) throws javax.jms.JMSException
MessageProducer using the given Sessionsession - the Session used to create the MessageProducerjmsDestination - the Destination to where the Messages will be publishedisTopic - 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 void registerMessageForAck(String ackId, javax.jms.Message message)
Message to the Session using the ackId in order to being
able later to perform a AckMode.MANUAL ACKackId - the id associated to the Session used to create the Messagemessage - the Message to use for executing the Message.acknowledge()IllegalArgumentException - if no Session was registered with the given AckIdpublic void doAck(String ackId) throws javax.jms.JMSException
Message.acknowledge() on the latest Message associated to the Session
identified by the ackIdackId - the id associated to the Session that should be ACKedjavax.jms.JMSException - if an error occurs during the ackpublic void stop()
throws org.mule.runtime.api.exception.MuleException
start method. When
the connection is stopped, delivery to all the connection's message
consumers is inhibited.stop in interface org.mule.runtime.api.lifecycle.Stoppableorg.mule.runtime.api.exception.MuleExceptionpublic void dispose()
dispose in interface org.mule.runtime.api.lifecycle.Disposablepublic void releaseResources()
Copyright © 2003–2017 MuleSoft, Inc.. All rights reserved.