org.apache.activemq.ra
Class ManagedSessionProxy
java.lang.Object
org.apache.activemq.ra.ManagedSessionProxy
- All Implemented Interfaces:
- java.lang.Runnable, javax.jms.QueueSession, javax.jms.Session, javax.jms.TopicSession
public class ManagedSessionProxy
- extends java.lang.Object
- implements javax.jms.Session, javax.jms.QueueSession, javax.jms.TopicSession
Acts as a pass through proxy for a JMS Session object. It intercepts events
that are of interest of the ActiveMQManagedConnection. There is one proxy for each session.
Fields inherited from interface javax.jms.Session |
AUTO_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE, DUPS_OK_ACKNOWLEDGE, SESSION_TRANSACTED |
Method Summary |
void |
cleanup()
Called by the ManagedConnectionProxy to invalidate this proxy. |
void |
close()
|
void |
commit()
|
javax.jms.QueueBrowser |
createBrowser(javax.jms.Queue queue)
|
javax.jms.QueueBrowser |
createBrowser(javax.jms.Queue queue,
java.lang.String messageSelector)
|
javax.jms.BytesMessage |
createBytesMessage()
|
javax.jms.MessageConsumer |
createConsumer(javax.jms.Destination destination)
|
javax.jms.MessageConsumer |
createConsumer(javax.jms.Destination destination,
java.lang.String messageSelector)
|
javax.jms.MessageConsumer |
createConsumer(javax.jms.Destination destination,
java.lang.String messageSelector,
boolean noLocal)
|
javax.jms.TopicSubscriber |
createDurableSubscriber(javax.jms.Topic topic,
java.lang.String name)
|
javax.jms.TopicSubscriber |
createDurableSubscriber(javax.jms.Topic topic,
java.lang.String name,
java.lang.String messageSelector,
boolean noLocal)
|
javax.jms.MapMessage |
createMapMessage()
|
javax.jms.Message |
createMessage()
|
javax.jms.ObjectMessage |
createObjectMessage()
|
javax.jms.ObjectMessage |
createObjectMessage(java.io.Serializable object)
|
javax.jms.MessageProducer |
createProducer(javax.jms.Destination destination)
|
javax.jms.TopicPublisher |
createPublisher(javax.jms.Topic topic)
|
javax.jms.Queue |
createQueue(java.lang.String queueName)
|
javax.jms.QueueReceiver |
createReceiver(javax.jms.Queue queue)
|
javax.jms.QueueReceiver |
createReceiver(javax.jms.Queue queue,
java.lang.String messageSelector)
|
javax.jms.QueueSender |
createSender(javax.jms.Queue queue)
|
javax.jms.StreamMessage |
createStreamMessage()
|
javax.jms.TopicSubscriber |
createSubscriber(javax.jms.Topic topic)
|
javax.jms.TopicSubscriber |
createSubscriber(javax.jms.Topic topic,
java.lang.String messageSelector,
boolean noLocal)
|
javax.jms.TemporaryQueue |
createTemporaryQueue()
|
javax.jms.TemporaryTopic |
createTemporaryTopic()
|
javax.jms.TextMessage |
createTextMessage()
|
javax.jms.TextMessage |
createTextMessage(java.lang.String text)
|
javax.jms.Topic |
createTopic(java.lang.String topicName)
|
int |
getAcknowledgeMode()
|
javax.jms.MessageListener |
getMessageListener()
|
boolean |
getTransacted()
|
void |
recover()
|
void |
rollback()
|
void |
run()
|
void |
setMessageListener(javax.jms.MessageListener listener)
|
void |
setUseSharedTxContext(boolean enable)
|
java.lang.String |
toString()
|
void |
unsubscribe(java.lang.String name)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
ManagedSessionProxy
public ManagedSessionProxy(ActiveMQSession session,
ManagedConnectionProxy connectionProxy)
setUseSharedTxContext
public void setUseSharedTxContext(boolean enable)
throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
close
public void close()
throws javax.jms.JMSException
- Specified by:
close
in interface javax.jms.Session
- Throws:
javax.jms.JMSException
cleanup
public void cleanup()
throws javax.jms.JMSException
- Called by the ManagedConnectionProxy to invalidate this proxy.
- Throws:
javax.jms.JMSException
- if session proxy has a problem
commit
public void commit()
throws javax.jms.JMSException
- Specified by:
commit
in interface javax.jms.Session
- Throws:
javax.jms.JMSException
createBrowser
public javax.jms.QueueBrowser createBrowser(javax.jms.Queue queue)
throws javax.jms.JMSException
- Specified by:
createBrowser
in interface javax.jms.QueueSession
- Specified by:
createBrowser
in interface javax.jms.Session
- Parameters:
queue
-
- Returns:
-
- Throws:
javax.jms.JMSException
createBrowser
public javax.jms.QueueBrowser createBrowser(javax.jms.Queue queue,
java.lang.String messageSelector)
throws javax.jms.JMSException
- Specified by:
createBrowser
in interface javax.jms.QueueSession
- Specified by:
createBrowser
in interface javax.jms.Session
- Parameters:
queue
- messageSelector
-
- Returns:
-
- Throws:
javax.jms.JMSException
createBytesMessage
public javax.jms.BytesMessage createBytesMessage()
throws javax.jms.JMSException
- Specified by:
createBytesMessage
in interface javax.jms.Session
- Returns:
-
- Throws:
javax.jms.JMSException
createConsumer
public javax.jms.MessageConsumer createConsumer(javax.jms.Destination destination)
throws javax.jms.JMSException
- Specified by:
createConsumer
in interface javax.jms.Session
- Parameters:
destination
-
- Returns:
-
- Throws:
javax.jms.JMSException
createConsumer
public javax.jms.MessageConsumer createConsumer(javax.jms.Destination destination,
java.lang.String messageSelector)
throws javax.jms.JMSException
- Specified by:
createConsumer
in interface javax.jms.Session
- Parameters:
destination
- messageSelector
-
- Returns:
-
- Throws:
javax.jms.JMSException
createConsumer
public javax.jms.MessageConsumer createConsumer(javax.jms.Destination destination,
java.lang.String messageSelector,
boolean noLocal)
throws javax.jms.JMSException
- Specified by:
createConsumer
in interface javax.jms.Session
- Parameters:
destination
- messageSelector
- noLocal
-
- Returns:
-
- Throws:
javax.jms.JMSException
createDurableSubscriber
public javax.jms.TopicSubscriber createDurableSubscriber(javax.jms.Topic topic,
java.lang.String name)
throws javax.jms.JMSException
- Specified by:
createDurableSubscriber
in interface javax.jms.Session
- Specified by:
createDurableSubscriber
in interface javax.jms.TopicSession
- Parameters:
topic
- name
-
- Returns:
-
- Throws:
javax.jms.JMSException
createDurableSubscriber
public javax.jms.TopicSubscriber createDurableSubscriber(javax.jms.Topic topic,
java.lang.String name,
java.lang.String messageSelector,
boolean noLocal)
throws javax.jms.JMSException
- Specified by:
createDurableSubscriber
in interface javax.jms.Session
- Specified by:
createDurableSubscriber
in interface javax.jms.TopicSession
- Parameters:
topic
- name
- messageSelector
- noLocal
-
- Returns:
-
- Throws:
javax.jms.JMSException
createMapMessage
public javax.jms.MapMessage createMapMessage()
throws javax.jms.JMSException
- Specified by:
createMapMessage
in interface javax.jms.Session
- Returns:
-
- Throws:
javax.jms.JMSException
createMessage
public javax.jms.Message createMessage()
throws javax.jms.JMSException
- Specified by:
createMessage
in interface javax.jms.Session
- Returns:
-
- Throws:
javax.jms.JMSException
createObjectMessage
public javax.jms.ObjectMessage createObjectMessage()
throws javax.jms.JMSException
- Specified by:
createObjectMessage
in interface javax.jms.Session
- Returns:
-
- Throws:
javax.jms.JMSException
createObjectMessage
public javax.jms.ObjectMessage createObjectMessage(java.io.Serializable object)
throws javax.jms.JMSException
- Specified by:
createObjectMessage
in interface javax.jms.Session
- Parameters:
object
-
- Returns:
-
- Throws:
javax.jms.JMSException
createProducer
public javax.jms.MessageProducer createProducer(javax.jms.Destination destination)
throws javax.jms.JMSException
- Specified by:
createProducer
in interface javax.jms.Session
- Parameters:
destination
-
- Returns:
-
- Throws:
javax.jms.JMSException
createQueue
public javax.jms.Queue createQueue(java.lang.String queueName)
throws javax.jms.JMSException
- Specified by:
createQueue
in interface javax.jms.QueueSession
- Specified by:
createQueue
in interface javax.jms.Session
- Parameters:
queueName
-
- Returns:
-
- Throws:
javax.jms.JMSException
createStreamMessage
public javax.jms.StreamMessage createStreamMessage()
throws javax.jms.JMSException
- Specified by:
createStreamMessage
in interface javax.jms.Session
- Returns:
-
- Throws:
javax.jms.JMSException
createTemporaryQueue
public javax.jms.TemporaryQueue createTemporaryQueue()
throws javax.jms.JMSException
- Specified by:
createTemporaryQueue
in interface javax.jms.QueueSession
- Specified by:
createTemporaryQueue
in interface javax.jms.Session
- Returns:
-
- Throws:
javax.jms.JMSException
createTemporaryTopic
public javax.jms.TemporaryTopic createTemporaryTopic()
throws javax.jms.JMSException
- Specified by:
createTemporaryTopic
in interface javax.jms.Session
- Specified by:
createTemporaryTopic
in interface javax.jms.TopicSession
- Returns:
-
- Throws:
javax.jms.JMSException
createTextMessage
public javax.jms.TextMessage createTextMessage()
throws javax.jms.JMSException
- Specified by:
createTextMessage
in interface javax.jms.Session
- Returns:
-
- Throws:
javax.jms.JMSException
createTextMessage
public javax.jms.TextMessage createTextMessage(java.lang.String text)
throws javax.jms.JMSException
- Specified by:
createTextMessage
in interface javax.jms.Session
- Parameters:
text
-
- Returns:
-
- Throws:
javax.jms.JMSException
createTopic
public javax.jms.Topic createTopic(java.lang.String topicName)
throws javax.jms.JMSException
- Specified by:
createTopic
in interface javax.jms.Session
- Specified by:
createTopic
in interface javax.jms.TopicSession
- Parameters:
topicName
-
- Returns:
-
- Throws:
javax.jms.JMSException
getAcknowledgeMode
public int getAcknowledgeMode()
throws javax.jms.JMSException
- Specified by:
getAcknowledgeMode
in interface javax.jms.Session
- Returns:
-
- Throws:
javax.jms.JMSException
getMessageListener
public javax.jms.MessageListener getMessageListener()
throws javax.jms.JMSException
- Specified by:
getMessageListener
in interface javax.jms.Session
- Returns:
-
- Throws:
javax.jms.JMSException
getTransacted
public boolean getTransacted()
throws javax.jms.JMSException
- Specified by:
getTransacted
in interface javax.jms.Session
- Returns:
-
- Throws:
javax.jms.JMSException
recover
public void recover()
throws javax.jms.JMSException
- Specified by:
recover
in interface javax.jms.Session
- Throws:
javax.jms.JMSException
rollback
public void rollback()
throws javax.jms.JMSException
- Specified by:
rollback
in interface javax.jms.Session
- Throws:
javax.jms.JMSException
setMessageListener
public void setMessageListener(javax.jms.MessageListener listener)
throws javax.jms.JMSException
- Specified by:
setMessageListener
in interface javax.jms.Session
- Parameters:
listener
-
- Throws:
javax.jms.JMSException
unsubscribe
public void unsubscribe(java.lang.String name)
throws javax.jms.JMSException
- Specified by:
unsubscribe
in interface javax.jms.Session
- Specified by:
unsubscribe
in interface javax.jms.TopicSession
- Parameters:
name
-
- Throws:
javax.jms.JMSException
createReceiver
public javax.jms.QueueReceiver createReceiver(javax.jms.Queue queue)
throws javax.jms.JMSException
- Specified by:
createReceiver
in interface javax.jms.QueueSession
- Parameters:
queue
-
- Returns:
-
- Throws:
javax.jms.JMSException
createReceiver
public javax.jms.QueueReceiver createReceiver(javax.jms.Queue queue,
java.lang.String messageSelector)
throws javax.jms.JMSException
- Specified by:
createReceiver
in interface javax.jms.QueueSession
- Parameters:
queue
- messageSelector
-
- Returns:
-
- Throws:
javax.jms.JMSException
createSender
public javax.jms.QueueSender createSender(javax.jms.Queue queue)
throws javax.jms.JMSException
- Specified by:
createSender
in interface javax.jms.QueueSession
- Parameters:
queue
-
- Returns:
-
- Throws:
javax.jms.JMSException
createPublisher
public javax.jms.TopicPublisher createPublisher(javax.jms.Topic topic)
throws javax.jms.JMSException
- Specified by:
createPublisher
in interface javax.jms.TopicSession
- Parameters:
topic
-
- Returns:
-
- Throws:
javax.jms.JMSException
createSubscriber
public javax.jms.TopicSubscriber createSubscriber(javax.jms.Topic topic)
throws javax.jms.JMSException
- Specified by:
createSubscriber
in interface javax.jms.TopicSession
- Parameters:
topic
-
- Returns:
-
- Throws:
javax.jms.JMSException
createSubscriber
public javax.jms.TopicSubscriber createSubscriber(javax.jms.Topic topic,
java.lang.String messageSelector,
boolean noLocal)
throws javax.jms.JMSException
- Specified by:
createSubscriber
in interface javax.jms.TopicSession
- Parameters:
topic
- messageSelector
- noLocal
-
- Returns:
-
- Throws:
javax.jms.JMSException
run
public void run()
- Specified by:
run
in interface java.lang.Runnable
- Specified by:
run
in interface javax.jms.Session
- See Also:
Session.run()
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
Copyright © 2005-2011. All Rights Reserved.