Class OutboundSession
- java.lang.Object
-
- org.objectweb.joram.client.connector.OutboundSession
-
- All Implemented Interfaces:
AutoCloseable,Runnable,Session
- Direct Known Subclasses:
OutboundQueueSession,OutboundTopicSession
public class OutboundSession extends Object implements 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) SessionsessThe wrapped JMS session.(package private) booleanstartedtrueif the session is started.protected booleantransacted(package private) booleanvalidtrueif this "handle" is valid.-
Fields inherited from interface javax.jms.Session
AUTO_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE, DUPS_OK_ACKNOWLEDGE, SESSION_TRANSACTED
-
-
Constructor Summary
Constructors Constructor Description OutboundSession(Session sess, OutboundConnection cnx)Constructs anOutboundSessioninstance.OutboundSession(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.QueueBrowsercreateBrowser(Queue queue)Delegates the call to the wrapped JMS session.QueueBrowsercreateBrowser(Queue queue, String selector)Delegates the call to the wrapped JMS session.BytesMessagecreateBytesMessage()Delegates the call to the wrapped JMS session.MessageConsumercreateConsumer(Destination dest)Delegates the call to the wrapped JMS session.MessageConsumercreateConsumer(Destination dest, String selector)Delegates the call to the wrapped JMS session.MessageConsumercreateConsumer(Destination dest, String selector, boolean noLocal)Delegates the call to the wrapped JMS session.MessageConsumercreateDurableConsumer(Topic topic, String name)Delegates the call to the wrapped JMS session.MessageConsumercreateDurableConsumer(Topic topic, String name, String messageSelector, boolean noLocal)Delegates the call to the wrapped JMS session.TopicSubscribercreateDurableSubscriber(Topic topic, String name)Delegates the call to the wrapped JMS session.TopicSubscribercreateDurableSubscriber(Topic topic, String name, String selector, boolean noLocal)Delegates the call to the wrapped JMS session.MapMessagecreateMapMessage()Delegates the call to the wrapped JMS session.MessagecreateMessage()Delegates the call to the wrapped JMS session.ObjectMessagecreateObjectMessage()Delegates the call to the wrapped JMS session.ObjectMessagecreateObjectMessage(Serializable obj)Delegates the call to the wrapped JMS session.MessageProducercreateProducer(Destination dest)Delegates the call to the wrapped JMS session.QueuecreateQueue(String queueName)Delegates the call to the wrapped JMS session.MessageConsumercreateSharedConsumer(Topic topic, String sharedSubscriptionName)Delegates the call to the wrapped JMS session.MessageConsumercreateSharedConsumer(Topic topic, String sharedSubscriptionName, String messageSelector)MessageConsumercreateSharedDurableConsumer(Topic topic, String name)Delegates the call to the wrapped JMS session.MessageConsumercreateSharedDurableConsumer(Topic topic, String name, String messageSelector)Delegates the call to the wrapped JMS session.StreamMessagecreateStreamMessage()Delegates the call to the wrapped JMS session.TemporaryQueuecreateTemporaryQueue()Delegates the call to the wrapped JMS session.TemporaryTopiccreateTemporaryTopic()Delegates the call to the wrapped JMS session.TextMessagecreateTextMessage()Delegates the call to the wrapped JMS session.TextMessagecreateTextMessage(String text)Delegates the call to the wrapped JMS session.TopiccreateTopic(String topicName)Delegates the call to the wrapped JMS session.intgetAcknowledgeMode()Delegates the call to the wrapped JMS session.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(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
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(Session sess, OutboundConnection cnx)
Constructs anOutboundSessioninstance.
-
OutboundSession
OutboundSession(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 IllegalStateExceptionChecks the validity of the session.- Throws:
IllegalStateException
-
getAcknowledgeMode
public int getAcknowledgeMode() throws JMSExceptionDelegates the call to the wrapped JMS session.- Specified by:
getAcknowledgeModein interfaceSession- Throws:
JMSException
-
getTransacted
public boolean getTransacted() throws JMSExceptionDelegates the call to the wrapped JMS session.- Specified by:
getTransactedin interfaceSession- Throws:
JMSException
-
setMessageListener
public void setMessageListener(MessageListener messageListener) throws JMSException
Forbidden call on a component's outbound session, throws aIllegalStateExceptioninstance.- Specified by:
setMessageListenerin interfaceSession- Throws:
JMSException
-
getMessageListener
public MessageListener getMessageListener() throws JMSException
Forbidden call on a component's outbound session, throws aIllegalStateExceptioninstance.- Specified by:
getMessageListenerin interfaceSession- Throws:
JMSException
-
createMessage
public Message createMessage() throws JMSException
Delegates the call to the wrapped JMS session.- Specified by:
createMessagein interfaceSession- Throws:
JMSException
-
createTextMessage
public TextMessage createTextMessage() throws JMSException
Delegates the call to the wrapped JMS session.- Specified by:
createTextMessagein interfaceSession- Throws:
JMSException
-
createTextMessage
public TextMessage createTextMessage(String text) throws JMSException
Delegates the call to the wrapped JMS session.- Specified by:
createTextMessagein interfaceSession- Throws:
JMSException
-
createBytesMessage
public BytesMessage createBytesMessage() throws JMSException
Delegates the call to the wrapped JMS session.- Specified by:
createBytesMessagein interfaceSession- Throws:
JMSException
-
createMapMessage
public MapMessage createMapMessage() throws JMSException
Delegates the call to the wrapped JMS session.- Specified by:
createMapMessagein interfaceSession- Throws:
JMSException
-
createObjectMessage
public ObjectMessage createObjectMessage() throws JMSException
Delegates the call to the wrapped JMS session.- Specified by:
createObjectMessagein interfaceSession- Throws:
JMSException
-
createObjectMessage
public ObjectMessage createObjectMessage(Serializable obj) throws JMSException
Delegates the call to the wrapped JMS session.- Specified by:
createObjectMessagein interfaceSession- Throws:
JMSException
-
createStreamMessage
public StreamMessage createStreamMessage() throws JMSException
Delegates the call to the wrapped JMS session.- Specified by:
createStreamMessagein interfaceSession- Throws:
JMSException
-
createBrowser
public QueueBrowser createBrowser(Queue queue, String selector) throws JMSException
Delegates the call to the wrapped JMS session.- Specified by:
createBrowserin interfaceSession- Throws:
JMSException
-
createBrowser
public QueueBrowser createBrowser(Queue queue) throws JMSException
Delegates the call to the wrapped JMS session.- Specified by:
createBrowserin interfaceSession- Throws:
JMSException
-
createProducer
public MessageProducer createProducer(Destination dest) throws JMSException
Delegates the call to the wrapped JMS session.- Specified by:
createProducerin interfaceSession- Throws:
JMSException
-
createConsumer
public MessageConsumer createConsumer(Destination dest, String selector, boolean noLocal) throws JMSException
Delegates the call to the wrapped JMS session.- Specified by:
createConsumerin interfaceSession- Throws:
JMSException
-
createConsumer
public MessageConsumer createConsumer(Destination dest, String selector) throws JMSException
Delegates the call to the wrapped JMS session.- Specified by:
createConsumerin interfaceSession- Throws:
JMSException
-
createConsumer
public MessageConsumer createConsumer(Destination dest) throws JMSException
Delegates the call to the wrapped JMS session.- Specified by:
createConsumerin interfaceSession- Throws:
JMSException
-
createDurableSubscriber
public TopicSubscriber createDurableSubscriber(Topic topic, String name, String selector, boolean noLocal) throws JMSException
Delegates the call to the wrapped JMS session.- Specified by:
createDurableSubscriberin interfaceSession- Throws:
JMSException
-
createDurableSubscriber
public TopicSubscriber createDurableSubscriber(Topic topic, String name) throws JMSException
Delegates the call to the wrapped JMS session.- Specified by:
createDurableSubscriberin interfaceSession- Throws:
JMSException
-
createQueue
public Queue createQueue(String queueName) throws JMSException
Delegates the call to the wrapped JMS session.- Specified by:
createQueuein interfaceSession- Throws:
JMSException
-
createTopic
public Topic createTopic(String topicName) throws JMSException
Delegates the call to the wrapped JMS session.- Specified by:
createTopicin interfaceSession- Throws:
JMSException
-
createTemporaryQueue
public TemporaryQueue createTemporaryQueue() throws JMSException
Delegates the call to the wrapped JMS session.- Specified by:
createTemporaryQueuein interfaceSession- Throws:
JMSException
-
createTemporaryTopic
public TemporaryTopic createTemporaryTopic() throws JMSException
Delegates the call to the wrapped JMS session.- Specified by:
createTemporaryTopicin interfaceSession- Throws:
JMSException
-
run
public void run()
Method never used by a component, does nothing.
-
commit
public void commit() throws JMSExceptionForbidden call on a component's outbound session, throws aIllegalStateExceptioninstance.- Specified by:
commitin interfaceSession- Throws:
JMSException
-
rollback
public void rollback() throws JMSExceptionForbidden call on a component's outbound session, throws aIllegalStateExceptioninstance.- Specified by:
rollbackin interfaceSession- Throws:
JMSException
-
recover
public void recover() throws JMSExceptionDelegates the call to the wrapped JMS session.- Specified by:
recoverin interfaceSession- Throws:
JMSException
-
unsubscribe
public void unsubscribe(String name) throws JMSException
Delegates the call to the wrapped JMS session.- Specified by:
unsubscribein interfaceSession- Throws:
JMSException
-
close
public void close() throws JMSExceptionIn Java EE, closing of the session occurs while closing the component's connection.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceSession- Throws:
JMSException
-
createSharedConsumer
public MessageConsumer createSharedConsumer(Topic topic, String sharedSubscriptionName) throws JMSException
Delegates the call to the wrapped JMS session.- Specified by:
createSharedConsumerin interfaceSession- Throws:
JMSException
-
createSharedConsumer
public MessageConsumer createSharedConsumer(Topic topic, String sharedSubscriptionName, String messageSelector) throws JMSException
- Specified by:
createSharedConsumerin interfaceSession- Throws:
JMSException
-
createDurableConsumer
public MessageConsumer createDurableConsumer(Topic topic, String name) throws JMSException
Delegates the call to the wrapped JMS session.- Specified by:
createDurableConsumerin interfaceSession- Throws:
JMSException
-
createDurableConsumer
public MessageConsumer createDurableConsumer(Topic topic, String name, String messageSelector, boolean noLocal) throws JMSException
Delegates the call to the wrapped JMS session.- Specified by:
createDurableConsumerin interfaceSession- Throws:
JMSException
-
createSharedDurableConsumer
public MessageConsumer createSharedDurableConsumer(Topic topic, String name) throws JMSException
Delegates the call to the wrapped JMS session.- Specified by:
createSharedDurableConsumerin interfaceSession- Throws:
JMSException
-
createSharedDurableConsumer
public MessageConsumer createSharedDurableConsumer(Topic topic, String name, String messageSelector) throws JMSException
Delegates the call to the wrapped JMS session.- Specified by:
createSharedDurableConsumerin interfaceSession- Throws:
JMSException
-
-