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
Fields Modifier and Type Field Description protected intconfiguredCreditprotected org.fusesource.hawtbuf.ByteArrayOutputStreamcurrentprotected byte[]recvBuffer-
Fields inherited from class org.apache.activemq.transport.amqp.protocol.AmqpAbstractLink
closeActions, closed, endpoint, opened, session
-
-
Constructor Summary
Constructors Constructor Description AmqpAbstractReceiver(AmqpSession session, org.apache.qpid.proton.engine.Receiver endpoint)Handle create of new AMQP Receiver instance.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidcommit(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.intgetConfiguredReceiverCredit()Returns 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(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, sendToActiveMQ
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.activemq.transport.amqp.protocol.AmqpLink
getDestination, setDestination
-
-
-
-
Constructor Detail
-
AmqpAbstractReceiver
public AmqpAbstractReceiver(AmqpSession session, org.apache.qpid.proton.engine.Receiver endpoint)
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 Detail
-
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
public void flow() throws ExceptionDescription 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
public void commit(LocalTransactionId txnId) throws Exception
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
public void rollback(LocalTransactionId txnId) throws Exception
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
public void delivery(org.apache.qpid.proton.engine.Delivery delivery) throws ExceptionDescription 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.
-
-