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 Method
ON_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 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()
-
-
-
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 interfaceInboundContext
- Specified by:
getSession
in interfaceServerSession
- 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 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:
start
in interfaceServerSession
- Throws:
JMSException
- See Also:
ServerSession.start()
-
run
public void run()
- Specified by:
run
in 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:
beforeDelivery
in 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:
afterDelivery
in interfaceActiveMQSession.DeliveryListener
-
release
public void release()
- Specified by:
release
in interfaceWork
- See Also:
Work.release()
-
toString
public String toString()
- Overrides:
toString
in classObject
- See Also:
Object.toString()
-
close
public void close()
-
-