bitronix.tm.resource.jms
Class MessageConsumerWrapper

java.lang.Object
  extended by bitronix.tm.resource.jms.MessageConsumerWrapper
All Implemented Interfaces:
javax.jms.MessageConsumer
Direct Known Subclasses:
TopicSubscriberWrapper

public class MessageConsumerWrapper
extends java.lang.Object
implements javax.jms.MessageConsumer

MessageConsumer wrapper that adds XA enlistment semantics.

© Bitronix Software

Author:
lorban

Field Summary
protected  DualSessionWrapper session
           
 
Constructor Summary
MessageConsumerWrapper(javax.jms.MessageConsumer messageConsumer, DualSessionWrapper session, PoolingConnectionFactory poolingConnectionFactory)
           
 
Method Summary
 void close()
           
protected  void enlistResource()
          Enlist this connection into the current transaction if automaticEnlistingEnabled = true for this resource.
 javax.jms.MessageConsumer getMessageConsumer()
           
 javax.jms.MessageListener getMessageListener()
           
 java.lang.String getMessageSelector()
           
 javax.jms.Message receive()
           
 javax.jms.Message receive(long timeout)
           
 javax.jms.Message receiveNoWait()
           
 void setMessageListener(javax.jms.MessageListener listener)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

session

protected DualSessionWrapper session
Constructor Detail

MessageConsumerWrapper

public MessageConsumerWrapper(javax.jms.MessageConsumer messageConsumer,
                              DualSessionWrapper session,
                              PoolingConnectionFactory poolingConnectionFactory)
Method Detail

getMessageConsumer

public javax.jms.MessageConsumer getMessageConsumer()

enlistResource

protected void enlistResource()
                       throws javax.jms.JMSException
Enlist this connection into the current transaction if automaticEnlistingEnabled = true for this resource. If no transaction is running then this method does nothing.

Throws:
javax.jms.JMSException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

receive

public javax.jms.Message receive()
                          throws javax.jms.JMSException
Specified by:
receive in interface javax.jms.MessageConsumer
Throws:
javax.jms.JMSException

receive

public javax.jms.Message receive(long timeout)
                          throws javax.jms.JMSException
Specified by:
receive in interface javax.jms.MessageConsumer
Throws:
javax.jms.JMSException

receiveNoWait

public javax.jms.Message receiveNoWait()
                                throws javax.jms.JMSException
Specified by:
receiveNoWait in interface javax.jms.MessageConsumer
Throws:
javax.jms.JMSException

close

public void close()
           throws javax.jms.JMSException
Specified by:
close in interface javax.jms.MessageConsumer
Throws:
javax.jms.JMSException

getMessageSelector

public java.lang.String getMessageSelector()
                                    throws javax.jms.JMSException
Specified by:
getMessageSelector in interface javax.jms.MessageConsumer
Throws:
javax.jms.JMSException

getMessageListener

public javax.jms.MessageListener getMessageListener()
                                             throws javax.jms.JMSException
Specified by:
getMessageListener in interface javax.jms.MessageConsumer
Throws:
javax.jms.JMSException

setMessageListener

public void setMessageListener(javax.jms.MessageListener listener)
                        throws javax.jms.JMSException
Specified by:
setMessageListener in interface javax.jms.MessageConsumer
Throws:
javax.jms.JMSException