org.apache.activemq.jms.pool
Class PooledSession

java.lang.Object
  extended by org.apache.activemq.jms.pool.PooledSession
All Implemented Interfaces:
Runnable, QueueSession, Session, TopicSession, XASession

public class PooledSession
extends Object
implements Session, TopicSession, QueueSession, XASession


Field Summary
 
Fields inherited from interface javax.jms.Session
AUTO_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE, DUPS_OK_ACKNOWLEDGE, SESSION_TRANSACTED
 
Constructor Summary
PooledSession(SessionKey key, Session session, KeyedObjectPool<SessionKey,PooledSession> sessionPool, boolean transactional)
           
 
Method Summary
 void addSessionEventListener(org.apache.activemq.jms.pool.PooledSessionEventListener listener)
           
 void close()
           
 void commit()
           
 QueueBrowser createBrowser(Queue queue)
           
 QueueBrowser createBrowser(Queue queue, String selector)
           
 BytesMessage createBytesMessage()
           
 MessageConsumer createConsumer(Destination destination)
           
 MessageConsumer createConsumer(Destination destination, String selector)
           
 MessageConsumer createConsumer(Destination destination, String selector, boolean noLocal)
           
 TopicSubscriber createDurableSubscriber(Topic topic, String selector)
           
 TopicSubscriber createDurableSubscriber(Topic topic, String name, String selector, boolean noLocal)
           
 MapMessage createMapMessage()
           
 Message createMessage()
           
 ObjectMessage createObjectMessage()
           
 ObjectMessage createObjectMessage(Serializable serializable)
           
 MessageProducer createProducer(Destination destination)
           
 TopicPublisher createPublisher(Topic topic)
           
 Queue createQueue(String s)
           
 QueueReceiver createReceiver(Queue queue)
           
 QueueReceiver createReceiver(Queue queue, String selector)
           
 QueueSender createSender(Queue queue)
           
 StreamMessage createStreamMessage()
           
 TopicSubscriber createSubscriber(Topic topic)
           
 TopicSubscriber createSubscriber(Topic topic, String selector, boolean local)
           
 TemporaryQueue createTemporaryQueue()
           
 TemporaryTopic createTemporaryTopic()
           
 TextMessage createTextMessage()
           
 TextMessage createTextMessage(String s)
           
 Topic createTopic(String s)
           
 int getAcknowledgeMode()
           
 Session getInternalSession()
           
 MessageListener getMessageListener()
           
 MessageProducer getMessageProducer()
           
 QueueSender getQueueSender()
           
 Session getSession()
           
 TopicPublisher getTopicPublisher()
           
 boolean getTransacted()
           
 XAResource getXAResource()
           
protected  boolean isIgnoreClose()
           
protected  void onConsumerClose(MessageConsumer consumer)
          Callback invoked when the consumer is closed.
 void recover()
           
 void rollback()
           
 void run()
           
protected  void setIgnoreClose(boolean ignoreClose)
           
 void setIsXa(boolean isXa)
           
 void setMessageListener(MessageListener messageListener)
           
 String toString()
           
 void unsubscribe(String s)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PooledSession

public PooledSession(SessionKey key,
                     Session session,
                     KeyedObjectPool<SessionKey,PooledSession> sessionPool,
                     boolean transactional)
Method Detail

addSessionEventListener

public void addSessionEventListener(org.apache.activemq.jms.pool.PooledSessionEventListener listener)

isIgnoreClose

protected boolean isIgnoreClose()

setIgnoreClose

protected void setIgnoreClose(boolean ignoreClose)

close

public void close()
           throws JMSException
Specified by:
close in interface Session
Throws:
JMSException

commit

public void commit()
            throws JMSException
Specified by:
commit in interface Session
Specified by:
commit in interface XASession
Throws:
JMSException

createBytesMessage

public BytesMessage createBytesMessage()
                                throws JMSException
Specified by:
createBytesMessage in interface Session
Throws:
JMSException

createMapMessage

public MapMessage createMapMessage()
                            throws JMSException
Specified by:
createMapMessage in interface Session
Throws:
JMSException

createMessage

public Message createMessage()
                      throws JMSException
Specified by:
createMessage in interface Session
Throws:
JMSException

createObjectMessage

public ObjectMessage createObjectMessage()
                                  throws JMSException
Specified by:
createObjectMessage in interface Session
Throws:
JMSException

createObjectMessage

public ObjectMessage createObjectMessage(Serializable serializable)
                                  throws JMSException
Specified by:
createObjectMessage in interface Session
Throws:
JMSException

createQueue

public Queue createQueue(String s)
                  throws JMSException
Specified by:
createQueue in interface QueueSession
Specified by:
createQueue in interface Session
Throws:
JMSException

createStreamMessage

public StreamMessage createStreamMessage()
                                  throws JMSException
Specified by:
createStreamMessage in interface Session
Throws:
JMSException

createTemporaryQueue

public TemporaryQueue createTemporaryQueue()
                                    throws JMSException
Specified by:
createTemporaryQueue in interface QueueSession
Specified by:
createTemporaryQueue in interface Session
Throws:
JMSException

createTemporaryTopic

public TemporaryTopic createTemporaryTopic()
                                    throws JMSException
Specified by:
createTemporaryTopic in interface Session
Specified by:
createTemporaryTopic in interface TopicSession
Throws:
JMSException

unsubscribe

public void unsubscribe(String s)
                 throws JMSException
Specified by:
unsubscribe in interface Session
Specified by:
unsubscribe in interface TopicSession
Throws:
JMSException

createTextMessage

public TextMessage createTextMessage()
                              throws JMSException
Specified by:
createTextMessage in interface Session
Throws:
JMSException

createTextMessage

public TextMessage createTextMessage(String s)
                              throws JMSException
Specified by:
createTextMessage in interface Session
Throws:
JMSException

createTopic

public Topic createTopic(String s)
                  throws JMSException
Specified by:
createTopic in interface Session
Specified by:
createTopic in interface TopicSession
Throws:
JMSException

getAcknowledgeMode

public int getAcknowledgeMode()
                       throws JMSException
Specified by:
getAcknowledgeMode in interface Session
Throws:
JMSException

getTransacted

public boolean getTransacted()
                      throws JMSException
Specified by:
getTransacted in interface Session
Specified by:
getTransacted in interface XASession
Throws:
JMSException

recover

public void recover()
             throws JMSException
Specified by:
recover in interface Session
Throws:
JMSException

rollback

public void rollback()
              throws JMSException
Specified by:
rollback in interface Session
Specified by:
rollback in interface XASession
Throws:
JMSException

getXAResource

public XAResource getXAResource()
Specified by:
getXAResource in interface XASession

getSession

public Session getSession()
Specified by:
getSession in interface XASession

run

public void run()
Specified by:
run in interface Runnable
Specified by:
run in interface Session

createBrowser

public QueueBrowser createBrowser(Queue queue)
                           throws JMSException
Specified by:
createBrowser in interface QueueSession
Specified by:
createBrowser in interface Session
Throws:
JMSException

createBrowser

public QueueBrowser createBrowser(Queue queue,
                                  String selector)
                           throws JMSException
Specified by:
createBrowser in interface QueueSession
Specified by:
createBrowser in interface Session
Throws:
JMSException

createConsumer

public MessageConsumer createConsumer(Destination destination)
                               throws JMSException
Specified by:
createConsumer in interface Session
Throws:
JMSException

createConsumer

public MessageConsumer createConsumer(Destination destination,
                                      String selector)
                               throws JMSException
Specified by:
createConsumer in interface Session
Throws:
JMSException

createConsumer

public MessageConsumer createConsumer(Destination destination,
                                      String selector,
                                      boolean noLocal)
                               throws JMSException
Specified by:
createConsumer in interface Session
Throws:
JMSException

createDurableSubscriber

public TopicSubscriber createDurableSubscriber(Topic topic,
                                               String selector)
                                        throws JMSException
Specified by:
createDurableSubscriber in interface Session
Specified by:
createDurableSubscriber in interface TopicSession
Throws:
JMSException

createDurableSubscriber

public TopicSubscriber createDurableSubscriber(Topic topic,
                                               String name,
                                               String selector,
                                               boolean noLocal)
                                        throws JMSException
Specified by:
createDurableSubscriber in interface Session
Specified by:
createDurableSubscriber in interface TopicSession
Throws:
JMSException

getMessageListener

public MessageListener getMessageListener()
                                   throws JMSException
Specified by:
getMessageListener in interface Session
Throws:
JMSException

setMessageListener

public void setMessageListener(MessageListener messageListener)
                        throws JMSException
Specified by:
setMessageListener in interface Session
Throws:
JMSException

createSubscriber

public TopicSubscriber createSubscriber(Topic topic)
                                 throws JMSException
Specified by:
createSubscriber in interface TopicSession
Throws:
JMSException

createSubscriber

public TopicSubscriber createSubscriber(Topic topic,
                                        String selector,
                                        boolean local)
                                 throws JMSException
Specified by:
createSubscriber in interface TopicSession
Throws:
JMSException

createReceiver

public QueueReceiver createReceiver(Queue queue)
                             throws JMSException
Specified by:
createReceiver in interface QueueSession
Throws:
JMSException

createReceiver

public QueueReceiver createReceiver(Queue queue,
                                    String selector)
                             throws JMSException
Specified by:
createReceiver in interface QueueSession
Throws:
JMSException

createProducer

public MessageProducer createProducer(Destination destination)
                               throws JMSException
Specified by:
createProducer in interface Session
Throws:
JMSException

createSender

public QueueSender createSender(Queue queue)
                         throws JMSException
Specified by:
createSender in interface QueueSession
Throws:
JMSException

createPublisher

public TopicPublisher createPublisher(Topic topic)
                               throws JMSException
Specified by:
createPublisher in interface TopicSession
Throws:
JMSException

onConsumerClose

protected void onConsumerClose(MessageConsumer consumer)
Callback invoked when the consumer is closed.

This is used to keep track of an explicit closed consumer created by this session, by which we know do not need to keep track of the consumer, as its already closed.

Parameters:
consumer - the consumer which is being closed

getInternalSession

public Session getInternalSession()
                           throws IllegalStateException
Throws:
IllegalStateException

getMessageProducer

public MessageProducer getMessageProducer()
                                   throws JMSException
Throws:
JMSException

getQueueSender

public QueueSender getQueueSender()
                           throws JMSException
Throws:
JMSException

getTopicPublisher

public TopicPublisher getTopicPublisher()
                                 throws JMSException
Throws:
JMSException

setIsXa

public void setIsXa(boolean isXa)

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2005–2013 The Apache Software Foundation. All rights reserved.