Class AmqpSession

java.lang.Object
org.apache.activemq.transport.amqp.protocol.AmqpSession
All Implemented Interfaces:
AmqpResource

public class AmqpSession extends Object implements AmqpResource
Wraps the AMQP Session and provides the services needed to manage the remote peer requests for link establishment.
  • Constructor Summary

    Constructors
    Constructor
    Description
    AmqpSession(AmqpConnection connection, org.apache.activemq.command.SessionId sessionId, org.apache.qpid.proton.engine.Session session)
    Create new AmqpSession instance whose parent is the given AmqpConnection.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Request from the remote peer to close this resource.
    void
    commit(org.apache.activemq.command.LocalTransactionId txId)
    Commits all pending work for all resources managed under this session.
    void
    createCoordinator(org.apache.qpid.proton.engine.Receiver protonReceiver)
     
    void
    createReceiver(org.apache.qpid.proton.engine.Receiver protonReceiver)
     
    void
    createSender(org.apache.qpid.proton.engine.Sender protonSender)
     
    void
    enlist(org.apache.activemq.command.TransactionId txId)
     
    void
    Used to direct all Session managed Senders to push any queued Messages out to the remote peer.
     
    org.apache.qpid.proton.engine.Session
     
    long
     
    org.apache.activemq.command.SessionId
     
    void
    Request from the remote peer to open this resource.
    void
    Send all pending work out to the remote peer.
    void
    registerSender(org.apache.activemq.command.ConsumerId consumerId, AmqpSender sender)
     
    void
    rollback(org.apache.activemq.command.LocalTransactionId txId)
    Rolls back any pending work being down under this session.
    void
    unregisterSender(org.apache.activemq.command.ConsumerId consumerId)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AmqpSession

      public AmqpSession(AmqpConnection connection, org.apache.activemq.command.SessionId sessionId, org.apache.qpid.proton.engine.Session session)
      Create new AmqpSession instance whose parent is the given AmqpConnection.
      Parameters:
      connection - the parent connection for this session.
      sessionId - the ActiveMQ SessionId that is used to identify this session.
      session - the AMQP Session that this class manages.
  • Method Details

    • open

      public void open()
      Description copied from interface: AmqpResource
      Request from the remote peer to open this resource.
      Specified by:
      open in interface AmqpResource
    • close

      public void close()
      Description copied from interface: AmqpResource
      Request from the remote peer to close this resource.
      Specified by:
      close in interface AmqpResource
    • commit

      public void commit(org.apache.activemq.command.LocalTransactionId txId) throws Exception
      Commits all pending work for all resources managed under this session.
      Parameters:
      txId - The specific TransactionId that is being committed.
      Throws:
      Exception - if an error occurs while attempting to commit work.
    • rollback

      public void rollback(org.apache.activemq.command.LocalTransactionId txId) throws Exception
      Rolls back any pending work being down under this session.
      Parameters:
      txId - The specific TransactionId that is being rolled back.
      Throws:
      Exception - if an error occurs while attempting to roll back work.
    • flushPendingMessages

      public void flushPendingMessages() throws Exception
      Used to direct all Session managed Senders to push any queued Messages out to the remote peer.
      Throws:
      Exception - if an error occurs while flushing the messages.
    • createCoordinator

      public void createCoordinator(org.apache.qpid.proton.engine.Receiver protonReceiver) throws Exception
      Throws:
      Exception
    • createReceiver

      public void createReceiver(org.apache.qpid.proton.engine.Receiver protonReceiver) throws Exception
      Throws:
      Exception
    • createSender

      public void createSender(org.apache.qpid.proton.engine.Sender protonSender) throws Exception
      Throws:
      Exception
    • pumpProtonToSocket

      public void pumpProtonToSocket()
      Send all pending work out to the remote peer.
    • registerSender

      public void registerSender(org.apache.activemq.command.ConsumerId consumerId, AmqpSender sender)
    • unregisterSender

      public void unregisterSender(org.apache.activemq.command.ConsumerId consumerId)
    • enlist

      public void enlist(org.apache.activemq.command.TransactionId txId)
    • getConnection

      public AmqpConnection getConnection()
    • getSessionId

      public org.apache.activemq.command.SessionId getSessionId()
    • getEndpoint

      public org.apache.qpid.proton.engine.Session getEndpoint()
    • getMaxFrameSize

      public long getMaxFrameSize()