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
    Modifier and Type
    Field
    Description
    static final Method
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    ServerSessionImpl(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 Type
    Method
    Description
    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.
    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.
    void
     
    jakarta.jms.MessageProducer
    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.
    jakarta.jms.Session
    Returns the current session being used to process a JMS message in the current thread.
    protected boolean
     
    protected boolean
     
    void
     
    void
    run()
     
    void
     
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • ON_MESSAGE_METHOD

      public static final Method 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.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 InboundContext
      Specified by:
      getSession in interface jakarta.jms.ServerSession
      Throws:
      jakarta.jms.JMSException
    • isStale

      protected boolean isStale()
    • isRunning

      protected boolean isRunning()
    • getMessageProducer

      public jakarta.jms.MessageProducer getMessageProducer() throws jakarta.jms.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:
      jakarta.jms.JMSException
    • start

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

      public void run()
      Specified by:
      run in interface Runnable
      See Also:
    • 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:
      beforeDelivery in interface org.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:
      afterDelivery in interface org.apache.activemq.ActiveMQSession.DeliveryListener
    • release

      public void release()
      Specified by:
      release in interface jakarta.resource.spi.work.Work
      See Also:
      • javax.resource.spi.work.Work#release()
    • toString

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

      public void close()