Package org.ow2.joram.jakarta.connector
Class OutboundSession
- java.lang.Object
-
- org.ow2.joram.jakarta.connector.OutboundSession
-
- All Implemented Interfaces:
jakarta.jms.Session,AutoCloseable,Runnable
- Direct Known Subclasses:
OutboundQueueSession,OutboundTopicSession
public class OutboundSession extends Object implements jakarta.jms.Session
AnOutboundSessioninstance wraps a JMS session (XA or not) for a component involved in outbound messaging.
-
-
Field Summary
Fields Modifier and Type Field Description protected OutboundConnectioncnxTheOutboundConnectionthe session belongs to.private static booleanDEBUGprivate static Loggerlogger(package private) jakarta.jms.SessionsessThe wrapped JMS session.(package private) booleanstartedtrueif the session is started.protected booleantransacted(package private) booleanvalidtrueif this "handle" is valid.
-
Constructor Summary
Constructors Constructor Description OutboundSession(jakarta.jms.Session sess, OutboundConnection cnx)Constructs anOutboundSessioninstance.OutboundSession(jakarta.jms.Session sess, OutboundConnection cnx, boolean transacted)Constructs anOutboundSessioninstance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) voidcheckValidity()Checks the validity of the session.voidclose()In Java EE, closing of the session occurs while closing the component's connection.voidcommit()Forbidden call on a component's outbound session, throws aIllegalStateExceptioninstance.jakarta.jms.QueueBrowsercreateBrowser(jakarta.jms.Queue queue)Delegates the call to the wrapped JMS session.jakarta.jms.QueueBrowsercreateBrowser(jakarta.jms.Queue queue, String selector)Delegates the call to the wrapped JMS session.jakarta.jms.BytesMessagecreateBytesMessage()Delegates the call to the wrapped JMS session.jakarta.jms.MessageConsumercreateConsumer(jakarta.jms.Destination dest)Delegates the call to the wrapped JMS session.jakarta.jms.MessageConsumercreateConsumer(jakarta.jms.Destination dest, String selector)Delegates the call to the wrapped JMS session.jakarta.jms.MessageConsumercreateConsumer(jakarta.jms.Destination dest, String selector, boolean noLocal)Delegates the call to the wrapped JMS session.jakarta.jms.MessageConsumercreateDurableConsumer(jakarta.jms.Topic topic, String name)Delegates the call to the wrapped JMS session.jakarta.jms.MessageConsumercreateDurableConsumer(jakarta.jms.Topic topic, String name, String messageSelector, boolean noLocal)Delegates the call to the wrapped JMS session.jakarta.jms.TopicSubscribercreateDurableSubscriber(jakarta.jms.Topic topic, String name)Delegates the call to the wrapped JMS session.jakarta.jms.TopicSubscribercreateDurableSubscriber(jakarta.jms.Topic topic, String name, String selector, boolean noLocal)Delegates the call to the wrapped JMS session.jakarta.jms.MapMessagecreateMapMessage()Delegates the call to the wrapped JMS session.jakarta.jms.MessagecreateMessage()Delegates the call to the wrapped JMS session.jakarta.jms.ObjectMessagecreateObjectMessage()Delegates the call to the wrapped JMS session.jakarta.jms.ObjectMessagecreateObjectMessage(Serializable obj)Delegates the call to the wrapped JMS session.jakarta.jms.MessageProducercreateProducer(jakarta.jms.Destination dest)Delegates the call to the wrapped JMS session.jakarta.jms.QueuecreateQueue(String queueName)Delegates the call to the wrapped JMS session.jakarta.jms.MessageConsumercreateSharedConsumer(jakarta.jms.Topic topic, String sharedSubscriptionName)Delegates the call to the wrapped JMS session.jakarta.jms.MessageConsumercreateSharedConsumer(jakarta.jms.Topic topic, String sharedSubscriptionName, String messageSelector)jakarta.jms.MessageConsumercreateSharedDurableConsumer(jakarta.jms.Topic topic, String name)Delegates the call to the wrapped JMS session.jakarta.jms.MessageConsumercreateSharedDurableConsumer(jakarta.jms.Topic topic, String name, String messageSelector)Delegates the call to the wrapped JMS session.jakarta.jms.StreamMessagecreateStreamMessage()Delegates the call to the wrapped JMS session.jakarta.jms.TemporaryQueuecreateTemporaryQueue()Delegates the call to the wrapped JMS session.jakarta.jms.TemporaryTopiccreateTemporaryTopic()Delegates the call to the wrapped JMS session.jakarta.jms.TextMessagecreateTextMessage()Delegates the call to the wrapped JMS session.jakarta.jms.TextMessagecreateTextMessage(String text)Delegates the call to the wrapped JMS session.jakarta.jms.TopiccreateTopic(String topicName)Delegates the call to the wrapped JMS session.intgetAcknowledgeMode()Delegates the call to the wrapped JMS session.jakarta.jms.MessageListenergetMessageListener()Forbidden call on a component's outbound session, throws aIllegalStateExceptioninstance.booleangetTransacted()Delegates the call to the wrapped JMS session.booleanisStarted()return started value.voidrecover()Delegates the call to the wrapped JMS session.voidrollback()Forbidden call on a component's outbound session, throws aIllegalStateExceptioninstance.voidrun()Method never used by a component, does nothing.voidsetMessageListener(jakarta.jms.MessageListener messageListener)Forbidden call on a component's outbound session, throws aIllegalStateExceptioninstance.(package private) voidstart()set started = trueStringtoString()voidunsubscribe(String name)Delegates the call to the wrapped JMS session.
-
-
-
Field Detail
-
logger
private static final Logger logger
-
DEBUG
private static final boolean DEBUG
-
cnx
protected OutboundConnection cnx
TheOutboundConnectionthe session belongs to.
-
sess
jakarta.jms.Session sess
The wrapped JMS session.
-
valid
boolean valid
trueif this "handle" is valid.
-
started
boolean started
trueif the session is started.
-
transacted
protected boolean transacted
-
-
Constructor Detail
-
OutboundSession
OutboundSession(jakarta.jms.Session sess, OutboundConnection cnx)Constructs anOutboundSessioninstance.
-
OutboundSession
OutboundSession(jakarta.jms.Session sess, OutboundConnection cnx, boolean transacted)Constructs anOutboundSessioninstance.
-
-
Method Detail
-
isStarted
public boolean isStarted()
return started value.
-
start
void start()
set started = true
-
checkValidity
void checkValidity() throws jakarta.jms.IllegalStateExceptionChecks the validity of the session.- Throws:
jakarta.jms.IllegalStateException
-
getAcknowledgeMode
public int getAcknowledgeMode() throws jakarta.jms.JMSExceptionDelegates the call to the wrapped JMS session.- Specified by:
getAcknowledgeModein interfacejakarta.jms.Session- Throws:
jakarta.jms.JMSException
-
getTransacted
public boolean getTransacted() throws jakarta.jms.JMSExceptionDelegates the call to the wrapped JMS session.- Specified by:
getTransactedin interfacejakarta.jms.Session- Throws:
jakarta.jms.JMSException
-
setMessageListener
public void setMessageListener(jakarta.jms.MessageListener messageListener) throws jakarta.jms.JMSExceptionForbidden call on a component's outbound session, throws aIllegalStateExceptioninstance.- Specified by:
setMessageListenerin interfacejakarta.jms.Session- Throws:
jakarta.jms.JMSException
-
getMessageListener
public jakarta.jms.MessageListener getMessageListener() throws jakarta.jms.JMSExceptionForbidden call on a component's outbound session, throws aIllegalStateExceptioninstance.- Specified by:
getMessageListenerin interfacejakarta.jms.Session- Throws:
jakarta.jms.JMSException
-
createMessage
public jakarta.jms.Message createMessage() throws jakarta.jms.JMSExceptionDelegates the call to the wrapped JMS session.- Specified by:
createMessagein interfacejakarta.jms.Session- Throws:
jakarta.jms.JMSException
-
createTextMessage
public jakarta.jms.TextMessage createTextMessage() throws jakarta.jms.JMSExceptionDelegates the call to the wrapped JMS session.- Specified by:
createTextMessagein interfacejakarta.jms.Session- Throws:
jakarta.jms.JMSException
-
createTextMessage
public jakarta.jms.TextMessage createTextMessage(String text) throws jakarta.jms.JMSException
Delegates the call to the wrapped JMS session.- Specified by:
createTextMessagein interfacejakarta.jms.Session- Throws:
jakarta.jms.JMSException
-
createBytesMessage
public jakarta.jms.BytesMessage createBytesMessage() throws jakarta.jms.JMSExceptionDelegates the call to the wrapped JMS session.- Specified by:
createBytesMessagein interfacejakarta.jms.Session- Throws:
jakarta.jms.JMSException
-
createMapMessage
public jakarta.jms.MapMessage createMapMessage() throws jakarta.jms.JMSExceptionDelegates the call to the wrapped JMS session.- Specified by:
createMapMessagein interfacejakarta.jms.Session- Throws:
jakarta.jms.JMSException
-
createObjectMessage
public jakarta.jms.ObjectMessage createObjectMessage() throws jakarta.jms.JMSExceptionDelegates the call to the wrapped JMS session.- Specified by:
createObjectMessagein interfacejakarta.jms.Session- Throws:
jakarta.jms.JMSException
-
createObjectMessage
public jakarta.jms.ObjectMessage createObjectMessage(Serializable obj) throws jakarta.jms.JMSException
Delegates the call to the wrapped JMS session.- Specified by:
createObjectMessagein interfacejakarta.jms.Session- Throws:
jakarta.jms.JMSException
-
createStreamMessage
public jakarta.jms.StreamMessage createStreamMessage() throws jakarta.jms.JMSExceptionDelegates the call to the wrapped JMS session.- Specified by:
createStreamMessagein interfacejakarta.jms.Session- Throws:
jakarta.jms.JMSException
-
createBrowser
public jakarta.jms.QueueBrowser createBrowser(jakarta.jms.Queue queue, String selector) throws jakarta.jms.JMSExceptionDelegates the call to the wrapped JMS session.- Specified by:
createBrowserin interfacejakarta.jms.Session- Throws:
jakarta.jms.JMSException
-
createBrowser
public jakarta.jms.QueueBrowser createBrowser(jakarta.jms.Queue queue) throws jakarta.jms.JMSExceptionDelegates the call to the wrapped JMS session.- Specified by:
createBrowserin interfacejakarta.jms.Session- Throws:
jakarta.jms.JMSException
-
createProducer
public jakarta.jms.MessageProducer createProducer(jakarta.jms.Destination dest) throws jakarta.jms.JMSExceptionDelegates the call to the wrapped JMS session.- Specified by:
createProducerin interfacejakarta.jms.Session- Throws:
jakarta.jms.JMSException
-
createConsumer
public jakarta.jms.MessageConsumer createConsumer(jakarta.jms.Destination dest, String selector, boolean noLocal) throws jakarta.jms.JMSExceptionDelegates the call to the wrapped JMS session.- Specified by:
createConsumerin interfacejakarta.jms.Session- Throws:
jakarta.jms.JMSException
-
createConsumer
public jakarta.jms.MessageConsumer createConsumer(jakarta.jms.Destination dest, String selector) throws jakarta.jms.JMSExceptionDelegates the call to the wrapped JMS session.- Specified by:
createConsumerin interfacejakarta.jms.Session- Throws:
jakarta.jms.JMSException
-
createConsumer
public jakarta.jms.MessageConsumer createConsumer(jakarta.jms.Destination dest) throws jakarta.jms.JMSExceptionDelegates the call to the wrapped JMS session.- Specified by:
createConsumerin interfacejakarta.jms.Session- Throws:
jakarta.jms.JMSException
-
createDurableSubscriber
public jakarta.jms.TopicSubscriber createDurableSubscriber(jakarta.jms.Topic topic, String name, String selector, boolean noLocal) throws jakarta.jms.JMSExceptionDelegates the call to the wrapped JMS session.- Specified by:
createDurableSubscriberin interfacejakarta.jms.Session- Throws:
jakarta.jms.JMSException
-
createDurableSubscriber
public jakarta.jms.TopicSubscriber createDurableSubscriber(jakarta.jms.Topic topic, String name) throws jakarta.jms.JMSExceptionDelegates the call to the wrapped JMS session.- Specified by:
createDurableSubscriberin interfacejakarta.jms.Session- Throws:
jakarta.jms.JMSException
-
createQueue
public jakarta.jms.Queue createQueue(String queueName) throws jakarta.jms.JMSException
Delegates the call to the wrapped JMS session.- Specified by:
createQueuein interfacejakarta.jms.Session- Throws:
jakarta.jms.JMSException
-
createTopic
public jakarta.jms.Topic createTopic(String topicName) throws jakarta.jms.JMSException
Delegates the call to the wrapped JMS session.- Specified by:
createTopicin interfacejakarta.jms.Session- Throws:
jakarta.jms.JMSException
-
createTemporaryQueue
public jakarta.jms.TemporaryQueue createTemporaryQueue() throws jakarta.jms.JMSExceptionDelegates the call to the wrapped JMS session.- Specified by:
createTemporaryQueuein interfacejakarta.jms.Session- Throws:
jakarta.jms.JMSException
-
createTemporaryTopic
public jakarta.jms.TemporaryTopic createTemporaryTopic() throws jakarta.jms.JMSExceptionDelegates the call to the wrapped JMS session.- Specified by:
createTemporaryTopicin interfacejakarta.jms.Session- Throws:
jakarta.jms.JMSException
-
run
public void run()
Method never used by a component, does nothing.
-
commit
public void commit() throws jakarta.jms.JMSExceptionForbidden call on a component's outbound session, throws aIllegalStateExceptioninstance.- Specified by:
commitin interfacejakarta.jms.Session- Throws:
jakarta.jms.JMSException
-
rollback
public void rollback() throws jakarta.jms.JMSExceptionForbidden call on a component's outbound session, throws aIllegalStateExceptioninstance.- Specified by:
rollbackin interfacejakarta.jms.Session- Throws:
jakarta.jms.JMSException
-
recover
public void recover() throws jakarta.jms.JMSExceptionDelegates the call to the wrapped JMS session.- Specified by:
recoverin interfacejakarta.jms.Session- Throws:
jakarta.jms.JMSException
-
unsubscribe
public void unsubscribe(String name) throws jakarta.jms.JMSException
Delegates the call to the wrapped JMS session.- Specified by:
unsubscribein interfacejakarta.jms.Session- Throws:
jakarta.jms.JMSException
-
close
public void close() throws jakarta.jms.JMSExceptionIn Java EE, closing of the session occurs while closing the component's connection.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfacejakarta.jms.Session- Throws:
jakarta.jms.JMSException
-
createSharedConsumer
public jakarta.jms.MessageConsumer createSharedConsumer(jakarta.jms.Topic topic, String sharedSubscriptionName) throws jakarta.jms.JMSExceptionDelegates the call to the wrapped JMS session.- Specified by:
createSharedConsumerin interfacejakarta.jms.Session- Throws:
jakarta.jms.JMSException
-
createSharedConsumer
public jakarta.jms.MessageConsumer createSharedConsumer(jakarta.jms.Topic topic, String sharedSubscriptionName, String messageSelector) throws jakarta.jms.JMSException- Specified by:
createSharedConsumerin interfacejakarta.jms.Session- Throws:
jakarta.jms.JMSException
-
createDurableConsumer
public jakarta.jms.MessageConsumer createDurableConsumer(jakarta.jms.Topic topic, String name) throws jakarta.jms.JMSExceptionDelegates the call to the wrapped JMS session.- Specified by:
createDurableConsumerin interfacejakarta.jms.Session- Throws:
jakarta.jms.JMSException
-
createDurableConsumer
public jakarta.jms.MessageConsumer createDurableConsumer(jakarta.jms.Topic topic, String name, String messageSelector, boolean noLocal) throws jakarta.jms.JMSExceptionDelegates the call to the wrapped JMS session.- Specified by:
createDurableConsumerin interfacejakarta.jms.Session- Throws:
jakarta.jms.JMSException
-
createSharedDurableConsumer
public jakarta.jms.MessageConsumer createSharedDurableConsumer(jakarta.jms.Topic topic, String name) throws jakarta.jms.JMSExceptionDelegates the call to the wrapped JMS session.- Specified by:
createSharedDurableConsumerin interfacejakarta.jms.Session- Throws:
jakarta.jms.JMSException
-
createSharedDurableConsumer
public jakarta.jms.MessageConsumer createSharedDurableConsumer(jakarta.jms.Topic topic, String name, String messageSelector) throws jakarta.jms.JMSExceptionDelegates the call to the wrapped JMS session.- Specified by:
createSharedDurableConsumerin interfacejakarta.jms.Session- Throws:
jakarta.jms.JMSException
-
-