Package org.apache.activemq.ra
Class ManagedSessionProxy
- java.lang.Object
-
- org.apache.activemq.ra.ManagedSessionProxy
-
- All Implemented Interfaces:
Runnable
,QueueSession
,Session
,TopicSession
public class ManagedSessionProxy extends Object implements Session, QueueSession, 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.
-
-
Field Summary
-
Fields inherited from interface javax.jms.Session
AUTO_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE, DUPS_OK_ACKNOWLEDGE, SESSION_TRANSACTED
-
-
Constructor Summary
Constructors Constructor Description ManagedSessionProxy(ActiveMQSession session, ManagedConnectionProxy connectionProxy)
-
Method Summary
-
-
-
Constructor Detail
-
ManagedSessionProxy
public ManagedSessionProxy(ActiveMQSession session, ManagedConnectionProxy connectionProxy)
-
-
Method Detail
-
setUseSharedTxContext
public void setUseSharedTxContext(boolean enable) throws JMSException
- Throws:
JMSException
-
close
public void close() throws JMSException
- Specified by:
close
in interfaceSession
- Throws:
JMSException
-
cleanup
public void cleanup() throws JMSException
Called by the ManagedConnectionProxy to invalidate this proxy.- Throws:
JMSException
- if session proxy has a problem
-
commit
public void commit() throws JMSException
- Specified by:
commit
in interfaceSession
- Throws:
JMSException
-
createBrowser
public QueueBrowser createBrowser(Queue queue) throws JMSException
- Specified by:
createBrowser
in interfaceQueueSession
- Specified by:
createBrowser
in interfaceSession
- Parameters:
queue
-- Returns:
- Throws:
JMSException
-
createBrowser
public QueueBrowser createBrowser(Queue queue, String messageSelector) throws JMSException
- Specified by:
createBrowser
in interfaceQueueSession
- Specified by:
createBrowser
in interfaceSession
- Parameters:
queue
-messageSelector
-- Returns:
- Throws:
JMSException
-
createBytesMessage
public BytesMessage createBytesMessage() throws JMSException
- Specified by:
createBytesMessage
in interfaceSession
- Returns:
- Throws:
JMSException
-
createConsumer
public MessageConsumer createConsumer(Destination destination) throws JMSException
- Specified by:
createConsumer
in interfaceSession
- Parameters:
destination
-- Returns:
- Throws:
JMSException
-
createConsumer
public MessageConsumer createConsumer(Destination destination, String messageSelector) throws JMSException
- Specified by:
createConsumer
in interfaceSession
- Parameters:
destination
-messageSelector
-- Returns:
- Throws:
JMSException
-
createConsumer
public MessageConsumer createConsumer(Destination destination, String messageSelector, boolean noLocal) throws JMSException
- Specified by:
createConsumer
in interfaceSession
- Parameters:
destination
-messageSelector
-noLocal
-- Returns:
- Throws:
JMSException
-
createDurableSubscriber
public TopicSubscriber createDurableSubscriber(Topic topic, String name) throws JMSException
- Specified by:
createDurableSubscriber
in interfaceSession
- Specified by:
createDurableSubscriber
in interfaceTopicSession
- Parameters:
topic
-name
-- Returns:
- Throws:
JMSException
-
createDurableSubscriber
public TopicSubscriber createDurableSubscriber(Topic topic, String name, String messageSelector, boolean noLocal) throws JMSException
- Specified by:
createDurableSubscriber
in interfaceSession
- Specified by:
createDurableSubscriber
in interfaceTopicSession
- Parameters:
topic
-name
-messageSelector
-noLocal
-- Returns:
- Throws:
JMSException
-
createMapMessage
public MapMessage createMapMessage() throws JMSException
- Specified by:
createMapMessage
in interfaceSession
- Returns:
- Throws:
JMSException
-
createMessage
public Message createMessage() throws JMSException
- Specified by:
createMessage
in interfaceSession
- Returns:
- Throws:
JMSException
-
createObjectMessage
public ObjectMessage createObjectMessage() throws JMSException
- Specified by:
createObjectMessage
in interfaceSession
- Returns:
- Throws:
JMSException
-
createObjectMessage
public ObjectMessage createObjectMessage(Serializable object) throws JMSException
- Specified by:
createObjectMessage
in interfaceSession
- Parameters:
object
-- Returns:
- Throws:
JMSException
-
createProducer
public MessageProducer createProducer(Destination destination) throws JMSException
- Specified by:
createProducer
in interfaceSession
- Parameters:
destination
-- Returns:
- Throws:
JMSException
-
createQueue
public Queue createQueue(String queueName) throws JMSException
- Specified by:
createQueue
in interfaceQueueSession
- Specified by:
createQueue
in interfaceSession
- Parameters:
queueName
-- Returns:
- Throws:
JMSException
-
createStreamMessage
public StreamMessage createStreamMessage() throws JMSException
- Specified by:
createStreamMessage
in interfaceSession
- Returns:
- Throws:
JMSException
-
createTemporaryQueue
public TemporaryQueue createTemporaryQueue() throws JMSException
- Specified by:
createTemporaryQueue
in interfaceQueueSession
- Specified by:
createTemporaryQueue
in interfaceSession
- Returns:
- Throws:
JMSException
-
createTemporaryTopic
public TemporaryTopic createTemporaryTopic() throws JMSException
- Specified by:
createTemporaryTopic
in interfaceSession
- Specified by:
createTemporaryTopic
in interfaceTopicSession
- Returns:
- Throws:
JMSException
-
createTextMessage
public TextMessage createTextMessage() throws JMSException
- Specified by:
createTextMessage
in interfaceSession
- Returns:
- Throws:
JMSException
-
createTextMessage
public TextMessage createTextMessage(String text) throws JMSException
- Specified by:
createTextMessage
in interfaceSession
- Parameters:
text
-- Returns:
- Throws:
JMSException
-
createTopic
public Topic createTopic(String topicName) throws JMSException
- Specified by:
createTopic
in interfaceSession
- Specified by:
createTopic
in interfaceTopicSession
- Parameters:
topicName
-- Returns:
- Throws:
JMSException
-
getAcknowledgeMode
public int getAcknowledgeMode() throws JMSException
- Specified by:
getAcknowledgeMode
in interfaceSession
- Returns:
- Throws:
JMSException
-
getMessageListener
public MessageListener getMessageListener() throws JMSException
- Specified by:
getMessageListener
in interfaceSession
- Returns:
- Throws:
JMSException
-
getTransacted
public boolean getTransacted() throws JMSException
- Specified by:
getTransacted
in interfaceSession
- Returns:
- Throws:
JMSException
-
recover
public void recover() throws JMSException
- Specified by:
recover
in interfaceSession
- Throws:
JMSException
-
rollback
public void rollback() throws JMSException
- Specified by:
rollback
in interfaceSession
- Throws:
JMSException
-
setMessageListener
public void setMessageListener(MessageListener listener) throws JMSException
- Specified by:
setMessageListener
in interfaceSession
- Parameters:
listener
-- Throws:
JMSException
-
unsubscribe
public void unsubscribe(String name) throws JMSException
- Specified by:
unsubscribe
in interfaceSession
- Specified by:
unsubscribe
in interfaceTopicSession
- Parameters:
name
-- Throws:
JMSException
-
createReceiver
public QueueReceiver createReceiver(Queue queue) throws JMSException
- Specified by:
createReceiver
in interfaceQueueSession
- Parameters:
queue
-- Returns:
- Throws:
JMSException
-
createReceiver
public QueueReceiver createReceiver(Queue queue, String messageSelector) throws JMSException
- Specified by:
createReceiver
in interfaceQueueSession
- Parameters:
queue
-messageSelector
-- Returns:
- Throws:
JMSException
-
createSender
public QueueSender createSender(Queue queue) throws JMSException
- Specified by:
createSender
in interfaceQueueSession
- Parameters:
queue
-- Returns:
- Throws:
JMSException
-
createPublisher
public TopicPublisher createPublisher(Topic topic) throws JMSException
- Specified by:
createPublisher
in interfaceTopicSession
- Parameters:
topic
-- Returns:
- Throws:
JMSException
-
createSubscriber
public TopicSubscriber createSubscriber(Topic topic) throws JMSException
- Specified by:
createSubscriber
in interfaceTopicSession
- Parameters:
topic
-- Returns:
- Throws:
JMSException
-
createSubscriber
public TopicSubscriber createSubscriber(Topic topic, String messageSelector, boolean noLocal) throws JMSException
- Specified by:
createSubscriber
in interfaceTopicSession
- Parameters:
topic
-messageSelector
-noLocal
-- Returns:
- Throws:
JMSException
-
run
public void run()
- Specified by:
run
in interfaceRunnable
- Specified by:
run
in interfaceSession
- See Also:
Session.run()
-
-