Class ProtonAbstractReceiver
- java.lang.Object
-
- org.apache.activemq.artemis.protocol.amqp.proton.ProtonInitializable
-
- org.apache.activemq.artemis.protocol.amqp.proton.ProtonAbstractReceiver
-
- All Implemented Interfaces:
ProtonDeliveryHandler
- Direct Known Subclasses:
AMQPMirrorControllerTarget,ProtonServerReceiverContext
public abstract class ProtonAbstractReceiver extends ProtonInitializable implements ProtonDeliveryHandler
-
-
Field Summary
Fields Modifier and Type Field Description protected intamqpCreditsprotected AMQPConnectionContextconnectionprotected java.lang.RunnablecreditRunnableWe create this AtomicRunnable with setRan.protected AMQPLargeMessagecurrentLargeMessageprotected intminCreditRefreshprotected intminLargeMessageSizeprotected intpendingSettlesprotected AMQPSessionContextprotonSessionprotected org.apache.qpid.proton.engine.Receiverreceiverprotected AMQPSessionCallbacksessionSPIprotected booleanuseModified
-
Constructor Summary
Constructors Constructor Description ProtonAbstractReceiver(AMQPSessionCallback sessionSPI, AMQPConnectionContext connection, AMQPSessionContext protonSession, org.apache.qpid.proton.engine.Receiver receiver)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract voidactualDelivery(AMQPMessage message, org.apache.qpid.proton.engine.Delivery delivery, org.apache.qpid.proton.engine.Receiver receiver, org.apache.activemq.artemis.core.transaction.Transaction tx)static intcalculatedUpdateRefill(int refill, int credits, int pending)protected voidclearLargeMessage()voidclose(boolean remoteLinkClose)voidclose(org.apache.qpid.proton.amqp.transport.ErrorCondition condition)static java.lang.RunnablecreateCreditRunnable(int refill, int threshold, org.apache.qpid.proton.engine.Receiver receiver, AMQPConnectionContext connection)This Credit Runnable may be used in Mock tests to simulate the credit semantic herestatic java.lang.RunnablecreateCreditRunnable(int refill, int threshold, org.apache.qpid.proton.engine.Receiver receiver, AMQPConnectionContext connection, ProtonAbstractReceiver context)This Credit Runnable may be used in Mock tests to simulate the credit semantic hereabstract voidflow()voidincrementSettle()protected voidinitializeCurrentLargeMessage(org.apache.qpid.proton.engine.Delivery delivery, org.apache.qpid.proton.engine.Receiver receiver)static booleanisBellowThreshold(int credit, int pending, int threshold)voidonFlow(int credits, boolean drain)voidonMessage(org.apache.qpid.proton.engine.Delivery delivery)protected voidrecoverContext()voidsettle(org.apache.qpid.proton.engine.Delivery settlement)-
Methods inherited from class org.apache.activemq.artemis.protocol.amqp.proton.ProtonInitializable
initialize, isInitialized
-
-
-
-
Field Detail
-
connection
protected final AMQPConnectionContext connection
-
protonSession
protected final AMQPSessionContext protonSession
-
receiver
protected final org.apache.qpid.proton.engine.Receiver receiver
-
amqpCredits
protected final int amqpCredits
-
minCreditRefresh
protected final int minCreditRefresh
-
minLargeMessageSize
protected final int minLargeMessageSize
-
sessionSPI
protected final AMQPSessionCallback sessionSPI
-
currentLargeMessage
protected volatile AMQPLargeMessage currentLargeMessage
-
creditRunnable
protected final java.lang.Runnable creditRunnable
We create this AtomicRunnable with setRan. This is because we always reuse the same instance. In case the creditRunnable was run, we reset and send it over. We set it as ran as the first one should always go through
-
useModified
protected final boolean useModified
-
pendingSettles
protected int pendingSettles
-
-
Constructor Detail
-
ProtonAbstractReceiver
public ProtonAbstractReceiver(AMQPSessionCallback sessionSPI, AMQPConnectionContext connection, AMQPSessionContext protonSession, org.apache.qpid.proton.engine.Receiver receiver)
-
-
Method Detail
-
isBellowThreshold
public static boolean isBellowThreshold(int credit, int pending, int threshold)
-
calculatedUpdateRefill
public static int calculatedUpdateRefill(int refill, int credits, int pending)
-
recoverContext
protected void recoverContext()
-
clearLargeMessage
protected void clearLargeMessage()
-
createCreditRunnable
public static java.lang.Runnable createCreditRunnable(int refill, int threshold, org.apache.qpid.proton.engine.Receiver receiver, AMQPConnectionContext connection, ProtonAbstractReceiver context)This Credit Runnable may be used in Mock tests to simulate the credit semantic here
-
createCreditRunnable
public static java.lang.Runnable createCreditRunnable(int refill, int threshold, org.apache.qpid.proton.engine.Receiver receiver, AMQPConnectionContext connection)This Credit Runnable may be used in Mock tests to simulate the credit semantic here
-
incrementSettle
public void incrementSettle()
-
settle
public void settle(org.apache.qpid.proton.engine.Delivery settlement)
-
onFlow
public void onFlow(int credits, boolean drain)- Specified by:
onFlowin interfaceProtonDeliveryHandler
-
onMessage
public void onMessage(org.apache.qpid.proton.engine.Delivery delivery) throws ActiveMQAMQPException- Specified by:
onMessagein interfaceProtonDeliveryHandler- Throws:
ActiveMQAMQPException
-
initializeCurrentLargeMessage
protected void initializeCurrentLargeMessage(org.apache.qpid.proton.engine.Delivery delivery, org.apache.qpid.proton.engine.Receiver receiver) throws java.lang.Exception- Throws:
java.lang.Exception
-
close
public void close(boolean remoteLinkClose) throws ActiveMQAMQPException- Specified by:
closein interfaceProtonDeliveryHandler- Throws:
ActiveMQAMQPException
-
close
public void close(org.apache.qpid.proton.amqp.transport.ErrorCondition condition) throws ActiveMQAMQPException- Specified by:
closein interfaceProtonDeliveryHandler- Throws:
ActiveMQAMQPException
-
actualDelivery
protected abstract void actualDelivery(AMQPMessage message, org.apache.qpid.proton.engine.Delivery delivery, org.apache.qpid.proton.engine.Receiver receiver, org.apache.activemq.artemis.core.transaction.Transaction tx)
-
flow
public abstract void flow()
-
-