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 Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAmqpAbstractResource(R resourceInfo, E endpoint) Creates a new instance with the JmsResource provided, and sets the Endpoint to the given value.AmqpAbstractResource(R resourceInfo, E endpoint, AmqpResourceParent parent) Creates a new instance with the JmsResource provided, and sets the Endpoint to the given value. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose(AsyncResult request) protected voidPerform the close operation on the managed endpoint.voidcloseResource(AmqpProvider provider, ProviderException cause, boolean remotelyClosed) org.apache.qpid.proton.engine.EndpointStateorg.apache.qpid.proton.engine.EndpointStatevoidhandleResourceClosure(AmqpProvider provider, ProviderException error) booleanbooleanisClosed()booleanisOpen()voidprocessDeliveryUpdates(AmqpProvider provider, org.apache.qpid.proton.engine.Delivery delivery) Called when the Proton Engine signals an Delivery related event has been triggered for the given endpoint.voidprocessFlowUpdates(AmqpProvider provider) Called when the Proton Engine signals an Flow related event has been triggered for the given endpoint.voidprocessRemoteClose(AmqpProvider provider) Event handler for remote peer close of this resource.voidprocessRemoteDetach(AmqpProvider provider) Event handler for remote peer detach of this resource.final voidprocessRemoteOpen(AmqpProvider provider) Event handler for remote peer open of this resource.
-
Field Details
-
closeRequest
-
closeTimeoutTask
-
-
Constructor Details
-
AmqpAbstractResource
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
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
-
closeResource
-
handleResourceClosure
-
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
-
getResourceInfo
-
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
Description copied from interface:AmqpEventSinkEvent handler for remote peer open of this resource.- Specified by:
processRemoteOpenin interfaceAmqpEventSink- Parameters:
provider- the AmqpProvider instance for easier access to fire events.- Throws:
ProviderException- if an error occurs while processing the update.
-
processRemoteDetach
Description copied from interface:AmqpEventSinkEvent handler for remote peer detach of this resource.- Specified by:
processRemoteDetachin interfaceAmqpEventSink- Parameters:
provider- the AmqpProvider instance for easier access to fire events.- Throws:
ProviderException- if an error occurs while processing the update.
-
processRemoteClose
Description copied from interface:AmqpEventSinkEvent handler for remote peer close of this resource.- Specified by:
processRemoteClosein interfaceAmqpEventSink- 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:AmqpEventSinkCalled when the Proton Engine signals an Delivery related event has been triggered for the given endpoint.- Specified by:
processDeliveryUpdatesin interfaceAmqpEventSink- 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
Description copied from interface:AmqpEventSinkCalled when the Proton Engine signals an Flow related event has been triggered for the given endpoint.- Specified by:
processFlowUpdatesin interfaceAmqpEventSink- Parameters:
provider- the AmqpProvider instance for easier access to fire events.- Throws:
ProviderException- if an error occurs while processing the update.
-