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 int
configuredCredit
protected org.fusesource.hawtbuf.ByteArrayOutputStream
current
protected 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 void
commit(LocalTransactionId txnId)
Handle work necessary on commit of transacted resources associated with this Link instance.void
delivery(org.apache.qpid.proton.engine.Delivery delivery)
Called when a new Delivery arrives for the given Link.void
detach()
Request from the remote peer to detach this resource.void
flow()
Handles an incoming flow control.void
flow(int credits)
Provide the receiver endpoint with the given amount of credits.int
getConfiguredReceiverCredit()
Returns the amount of receiver credit that has been configured for this AMQP transport.protected abstract void
processDelivery(org.apache.qpid.proton.engine.Delivery delivery, org.fusesource.hawtbuf.Buffer deliveryBytes)
void
rollback(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:AmqpLink
Request from the remote peer to detach this resource.- Specified by:
detach
in interfaceAmqpLink
- Overrides:
detach
in classAmqpAbstractLink<org.apache.qpid.proton.engine.Receiver>
-
flow
public void flow() throws Exception
Description copied from interface:AmqpLink
Handles 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:AmqpLink
Handle 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:AmqpLink
Handle 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 Exception
Description copied from interface:AmqpLink
Called 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.
-
-