Package org.apache.activemq.ra
Class ServerSessionImpl
- java.lang.Object
-
- 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
Fields Modifier and Type Field Description static MethodON_MESSAGE_METHOD
-
Constructor Summary
Constructors Constructor Description ServerSessionImpl(ServerSessionPoolImpl pool, ActiveMQSession session, WorkManager workManager, MessageEndpoint endpoint, boolean useRAManagedTx, int batchSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterDelivery(ActiveMQSession session, Message msg)The ActiveMQSession's run method will call back to this method after dispactching a message to the MessageListener.voidbeforeDelivery(ActiveMQSession session, Message msg)The ActiveMQSession's run method will call back to this method before dispactching a message to the MessageListener.voidclose()MessageProducergetMessageProducer()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.SessiongetSession()Returns the current session being used to process a JMS message in the current thread.protected booleanisStale()voidrelease()voidrun()voidstart()StringtoString()
-
-
-
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:InboundContextReturns the current session being used to process a JMS message in the current thread.- Specified by:
getSessionin interfaceInboundContext- Specified by:
getSessionin interfaceServerSession- Throws:
JMSException
-
isStale
protected boolean isStale()
-
getMessageProducer
public MessageProducer getMessageProducer() throws JMSException
Description copied from interface:InboundContextLazily 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:
getMessageProducerin interfaceInboundContext- 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:
startin interfaceServerSession- Throws:
JMSException- See Also:
ServerSession.start()
-
run
public void run()
- Specified by:
runin interfaceRunnable- 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:
beforeDeliveryin interfaceActiveMQSession.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:
afterDeliveryin interfaceActiveMQSession.DeliveryListener
-
release
public void release()
- Specified by:
releasein interfaceWork- See Also:
Work.release()
-
toString
public String toString()
- Overrides:
toStringin classObject- See Also:
Object.toString()
-
close
public void close()
-
-