Package org.apache.activemq.ra
Class ServerSessionImpl
java.lang.Object
org.apache.activemq.ra.ServerSessionImpl
- All Implemented Interfaces:
jakarta.jms.ServerSession,jakarta.resource.spi.work.Work,Runnable,org.apache.activemq.ActiveMQSession.DeliveryListener,InboundContext
public class ServerSessionImpl
extends Object
implements jakarta.jms.ServerSession, InboundContext, jakarta.resource.spi.work.Work, org.apache.activemq.ActiveMQSession.DeliveryListener
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionServerSessionImpl(ServerSessionPoolImpl pool, org.apache.activemq.ActiveMQSession session, jakarta.resource.spi.work.WorkManager workManager, jakarta.resource.spi.endpoint.MessageEndpoint endpoint, boolean useRAManagedTx, int batchSize) -
Method Summary
Modifier and TypeMethodDescriptionvoidafterDelivery(org.apache.activemq.ActiveMQSession session, jakarta.jms.Message msg) The ActiveMQSession's run method will call back to this method after dispactching a message to the MessageListener.voidbeforeDelivery(org.apache.activemq.ActiveMQSession session, jakarta.jms.Message msg) The ActiveMQSession's run method will call back to this method before dispactching a message to the MessageListener.voidclose()jakarta.jms.MessageProducerLazily 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.jakarta.jms.SessionReturns the current session being used to process a JMS message in the current thread.protected booleanprotected booleanisStale()voidrelease()voidrun()voidstart()toString()
-
Field Details
-
ON_MESSAGE_METHOD
-
-
Constructor Details
-
ServerSessionImpl
public ServerSessionImpl(ServerSessionPoolImpl pool, org.apache.activemq.ActiveMQSession session, jakarta.resource.spi.work.WorkManager workManager, jakarta.resource.spi.endpoint.MessageEndpoint endpoint, boolean useRAManagedTx, int batchSize) throws jakarta.jms.JMSException - Throws:
jakarta.jms.JMSException
-
-
Method Details
-
getSession
public jakarta.jms.Session getSession() throws jakarta.jms.JMSExceptionDescription 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 interfacejakarta.jms.ServerSession- Throws:
jakarta.jms.JMSException
-
isStale
protected boolean isStale() -
isRunning
protected boolean isRunning() -
getMessageProducer
public jakarta.jms.MessageProducer getMessageProducer() throws jakarta.jms.JMSExceptionDescription 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:
jakarta.jms.JMSException
-
start
public void start() throws jakarta.jms.JMSException- Specified by:
startin interfacejakarta.jms.ServerSession- Throws:
jakarta.jms.JMSException- See Also:
-
ServerSession.start()
-
run
public void run() -
beforeDelivery
public void beforeDelivery(org.apache.activemq.ActiveMQSession session, jakarta.jms.Message msg) The ActiveMQSession's run method will call back to this method before dispactching a message to the MessageListener.- Specified by:
beforeDeliveryin interfaceorg.apache.activemq.ActiveMQSession.DeliveryListener
-
afterDelivery
public void afterDelivery(org.apache.activemq.ActiveMQSession session, jakarta.jms.Message msg) The ActiveMQSession's run method will call back to this method after dispactching a message to the MessageListener.- Specified by:
afterDeliveryin interfaceorg.apache.activemq.ActiveMQSession.DeliveryListener
-
release
public void release()- Specified by:
releasein interfacejakarta.resource.spi.work.Work- See Also:
-
javax.resource.spi.work.Work#release()
-
toString
-
close
public void close()
-