Class AmqpAbstractReceiver
java.lang.Object
org.apache.activemq.transport.amqp.protocol.AmqpAbstractLink<org.apache.qpid.proton.engine.Receiver>
org.apache.activemq.transport.amqp.protocol.AmqpAbstractReceiver
- All Implemented Interfaces:
AmqpLink,AmqpResource
- Direct Known Subclasses:
AmqpReceiver,AmqpTransactionCoordinator
public abstract class AmqpAbstractReceiver
extends AmqpAbstractLink<org.apache.qpid.proton.engine.Receiver>
Abstract base that provides common services for AMQP Receiver types.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final intprotected org.fusesource.hawtbuf.ByteArrayOutputStreamprotected final byte[]Fields inherited from class org.apache.activemq.transport.amqp.protocol.AmqpAbstractLink
closeActions, closed, endpoint, opened, session -
Constructor Summary
ConstructorsConstructorDescriptionAmqpAbstractReceiver(AmqpSession session, org.apache.qpid.proton.engine.Receiver endpoint) Handle create of new AMQP Receiver instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidcommit(org.apache.activemq.command.LocalTransactionId txnId) Handle work necessary on commit of transacted resources associated with this Link instance.voiddelivery(org.apache.qpid.proton.engine.Delivery delivery) Called when a new Delivery arrives for the given Link.voiddetach()Request from the remote peer to detach this resource.voidflow()Handles an incoming flow control.voidflow(int credits) Provide the receiver endpoint with the given amount of credits.intReturns the amount of receiver credit that has been configured for this AMQP transport.protected abstract voidprocessDelivery(org.apache.qpid.proton.engine.Delivery delivery, org.fusesource.hawtbuf.Buffer deliveryBytes) voidrollback(org.apache.activemq.command.LocalTransactionId txnId) Handle work necessary on rollback of transacted resources associated with this Link instance.Methods inherited from class org.apache.activemq.transport.amqp.protocol.AmqpAbstractLink
addCloseAction, close, close, getEndpoint, getSession, isClosed, isOpened, open, sendToActiveMQ, sendToActiveMQMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.activemq.transport.amqp.protocol.AmqpLink
getDestination, setDestination
-
Field Details
-
current
protected org.fusesource.hawtbuf.ByteArrayOutputStream current -
recvBuffer
protected final byte[] recvBuffer -
configuredCredit
protected final int configuredCredit
-
-
Constructor Details
-
AmqpAbstractReceiver
Handle create of new AMQP Receiver instance.- Parameters:
session- the AmqpSession that servers as the parent of this Link.endpoint- the Receiver endpoint being managed by this class.
-
-
Method Details
-
detach
public void detach()Description copied from interface:AmqpLinkRequest from the remote peer to detach this resource.- Specified by:
detachin interfaceAmqpLink- Overrides:
detachin classAmqpAbstractLink<org.apache.qpid.proton.engine.Receiver>
-
flow
Description copied from interface:AmqpLinkHandles an incoming flow control.- Throws:
Exception
-
getConfiguredReceiverCredit
public int getConfiguredReceiverCredit()Returns the amount of receiver credit that has been configured for this AMQP transport. If no value was configured on the TransportConnector URI then a sensible default is used.- Returns:
- the configured receiver credit to grant.
-
flow
public void flow(int credits) Provide the receiver endpoint with the given amount of credits.- Parameters:
credits- the credit value to pass on to the wrapped Receiver.
-
commit
Description copied from interface:AmqpLinkHandle work necessary on commit of transacted resources associated with this Link instance.- Parameters:
txnId- The Transaction ID being committed.- Throws:
Exception- if an error occurs while performing the commit.
-
rollback
Description copied from interface:AmqpLinkHandle work necessary on rollback of transacted resources associated with this Link instance.- Parameters:
txnId- The Transaction ID being rolled back.- Throws:
Exception- if an error occurs while performing the rollback.
-
delivery
Description copied from interface:AmqpLinkCalled when a new Delivery arrives for the given Link.- Parameters:
delivery- the newly arrived delivery on this link.- Throws:
Exception- if an error occurs while processing the new Delivery.
-
processDelivery
protected abstract void processDelivery(org.apache.qpid.proton.engine.Delivery delivery, org.fusesource.hawtbuf.Buffer deliveryBytes) throws Exception - Throws:
Exception
-