org.apache.activemq.ra
Class ServerSessionImpl

java.lang.Object
  extended by org.apache.activemq.ra.ServerSessionImpl
All Implemented Interfaces:
Runnable, ServerSession, Work, ActiveMQSession.DeliveryListener, InboundContext

public class ServerSessionImpl
extends Object
implements ServerSession, InboundContext, Work, ActiveMQSession.DeliveryListener


Field Summary
static Method ON_MESSAGE_METHOD
           
 
Constructor Summary
ServerSessionImpl(ServerSessionPoolImpl pool, ActiveMQSession session, WorkManager workManager, MessageEndpoint endpoint, boolean useRAManagedTx, int batchSize)
           
 
Method Summary
 void afterDelivery(ActiveMQSession session, Message msg)
          The ActiveMQSession's run method will call back to this method after dispactching a message to the MessageListener.
 void beforeDelivery(ActiveMQSession session, Message msg)
          The ActiveMQSession's run method will call back to this method before dispactching a message to the MessageListener.
 void close()
           
 MessageProducer getMessageProducer()
          Lazily creates a message producer that can be used to send messages using the same JMS Session which is being used to dispatch messages which minimises the XA overheard of consuming and producing or allows JMS transactions to be used for consuming and producing messages.
 Session getSession()
          Returns the current session being used to process a JMS message in the current thread.
protected  boolean isStale()
           
 void release()
           
 void run()
           
 void start()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ON_MESSAGE_METHOD

public static final Method ON_MESSAGE_METHOD
Constructor Detail

ServerSessionImpl

public ServerSessionImpl(ServerSessionPoolImpl pool,
                         ActiveMQSession session,
                         WorkManager workManager,
                         MessageEndpoint endpoint,
                         boolean useRAManagedTx,
                         int batchSize)
                  throws JMSException
Throws:
JMSException
Method Detail

getSession

public Session getSession()
                   throws JMSException
Description copied from interface: InboundContext
Returns the current session being used to process a JMS message in the current thread.

Specified by:
getSession in interface ServerSession
Specified by:
getSession in interface InboundContext
Throws:
JMSException

isStale

protected boolean isStale()

getMessageProducer

public MessageProducer getMessageProducer()
                                   throws JMSException
Description copied from interface: InboundContext
Lazily creates a message producer that can be used to send messages using the same JMS Session which is being used to dispatch messages which minimises the XA overheard of consuming and producing or allows JMS transactions to be used for consuming and producing messages.

Specified by:
getMessageProducer in interface InboundContext
Returns:
the current message producer or a new one is lazily created, using a null destination so the destination must be specified on a send() method.
Throws:
JMSException

start

public void start()
           throws JMSException
Specified by:
start in interface ServerSession
Throws:
JMSException
See Also:
ServerSession.start()

run

public void run()
Specified by:
run in interface Runnable
See Also:
Runnable.run()

beforeDelivery

public void beforeDelivery(ActiveMQSession session,
                           Message msg)
The ActiveMQSession's run method will call back to this method before dispactching a message to the MessageListener.

Specified by:
beforeDelivery in interface ActiveMQSession.DeliveryListener

afterDelivery

public void afterDelivery(ActiveMQSession session,
                          Message msg)
The ActiveMQSession's run method will call back to this method after dispactching a message to the MessageListener.

Specified by:
afterDelivery in interface ActiveMQSession.DeliveryListener

release

public void release()
Specified by:
release in interface Work
See Also:
Work.release()

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()

close

public void close()


Copyright © 2005-2013 The Apache Software Foundation. All Rights Reserved.