Class AmqpAbstractResource<R extends JmsResource,E extends org.apache.qpid.proton.engine.Endpoint>

java.lang.Object
org.apache.qpid.jms.provider.amqp.AmqpAbstractResource<R,E>
Type Parameters:
R - The JmsResource type that describe this resource.
E - The AMQP Endpoint that this resource encapsulates.
All Implemented Interfaces:
AmqpEventSink, AmqpResource
Direct Known Subclasses:
AmqpConnection, AmqpConsumer, AmqpProducer, AmqpSession, AmqpTemporaryDestination, AmqpTransactionCoordinator

public abstract class AmqpAbstractResource<R extends JmsResource,E extends org.apache.qpid.proton.engine.Endpoint> extends Object implements AmqpResource
Abstract base for all AmqpResource implementations to extend. This abstract class wraps up the basic state management bits so that the concrete object don't have to reproduce it. Provides hooks for the subclasses to initialize and shutdown.
  • Field Details

  • Constructor Details

    • AmqpAbstractResource

      public AmqpAbstractResource(R resourceInfo, E endpoint)
      Creates a new instance with the JmsResource provided, and sets the Endpoint to the given value.
      Parameters:
      resourceInfo - The JmsResource instance that this AmqpResource is managing.
      endpoint - The Proton Endpoint instance that this object maps to.
    • AmqpAbstractResource

      public AmqpAbstractResource(R resourceInfo, E endpoint, AmqpResourceParent parent)
      Creates a new instance with the JmsResource provided, and sets the Endpoint to the given value.
      Parameters:
      resourceInfo - The JmsResource instance that this AmqpResource is managing.
      endpoint - The Proton Endpoint instance that this object maps to.
      parent - The parent of this resource (null if no parent).
  • Method Details

    • close

      public void close(AsyncResult request)
    • closeResource

      public void closeResource(AmqpProvider provider, ProviderException cause, boolean remotelyClosed)
    • handleResourceClosure

      public void handleResourceClosure(AmqpProvider provider, ProviderException error)
    • closeOrDetachEndpoint

      protected void closeOrDetachEndpoint()
      Perform the close operation on the managed endpoint. A subclass may override this method to alter the standard close path such as endpoint detach etc.
    • getEndpoint

      public E getEndpoint()
    • getResourceInfo

      public R getResourceInfo()
    • getParent

      public AmqpResourceParent getParent()
    • isOpen

      public boolean isOpen()
    • isClosed

      public boolean isClosed()
    • isAwaitingClose

      public boolean isAwaitingClose()
    • getLocalState

      public org.apache.qpid.proton.engine.EndpointState getLocalState()
    • getRemoteState

      public org.apache.qpid.proton.engine.EndpointState getRemoteState()
    • processRemoteOpen

      public final void processRemoteOpen(AmqpProvider provider) throws ProviderException
      Description copied from interface: AmqpEventSink
      Event handler for remote peer open of this resource.
      Specified by:
      processRemoteOpen in interface AmqpEventSink
      Parameters:
      provider - the AmqpProvider instance for easier access to fire events.
      Throws:
      ProviderException - if an error occurs while processing the update.
    • processRemoteDetach

      public void processRemoteDetach(AmqpProvider provider) throws ProviderException
      Description copied from interface: AmqpEventSink
      Event handler for remote peer detach of this resource.
      Specified by:
      processRemoteDetach in interface AmqpEventSink
      Parameters:
      provider - the AmqpProvider instance for easier access to fire events.
      Throws:
      ProviderException - if an error occurs while processing the update.
    • processRemoteClose

      public void processRemoteClose(AmqpProvider provider) throws ProviderException
      Description copied from interface: AmqpEventSink
      Event handler for remote peer close of this resource.
      Specified by:
      processRemoteClose in interface AmqpEventSink
      Parameters:
      provider - the AmqpProvider instance for easier access to fire events.
      Throws:
      ProviderException - if an error occurs while processing the update.
    • processDeliveryUpdates

      public void processDeliveryUpdates(AmqpProvider provider, org.apache.qpid.proton.engine.Delivery delivery) throws ProviderException
      Description copied from interface: AmqpEventSink
      Called when the Proton Engine signals an Delivery related event has been triggered for the given endpoint.
      Specified by:
      processDeliveryUpdates in interface AmqpEventSink
      Parameters:
      provider - the AmqpProvider instance for easier access to fire events.
      delivery - the Delivery that has an update to its state which needs handled.
      Throws:
      ProviderException - if an error occurs while processing the update.
    • processFlowUpdates

      public void processFlowUpdates(AmqpProvider provider) throws ProviderException
      Description copied from interface: AmqpEventSink
      Called when the Proton Engine signals an Flow related event has been triggered for the given endpoint.
      Specified by:
      processFlowUpdates in interface AmqpEventSink
      Parameters:
      provider - the AmqpProvider instance for easier access to fire events.
      Throws:
      ProviderException - if an error occurs while processing the update.