Class ProtonServerSenderContext
- java.lang.Object
-
- org.apache.activemq.artemis.protocol.amqp.proton.ProtonInitializable
-
- org.apache.activemq.artemis.protocol.amqp.proton.ProtonServerSenderContext
-
- All Implemented Interfaces:
ProtonDeliveryHandler
- Direct Known Subclasses:
ProtonClientSenderContext
public class ProtonServerSenderContext extends ProtonInitializable implements ProtonDeliveryHandler
This is the Equivalent for the ServerConsumer
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanclosedprotected AMQPConnectionContextconnectionprotected AMQPSessionContextprotonSessionprotected org.apache.qpid.proton.engine.Sendersenderprotected AMQPSessionCallbacksessionSPI
-
Constructor Summary
Constructors Constructor Description ProtonServerSenderContext(AMQPConnectionContext connection, org.apache.qpid.proton.engine.Sender sender, AMQPSessionContext protonSession, AMQPSessionCallback server)ProtonServerSenderContext(AMQPConnectionContext connection, org.apache.qpid.proton.engine.Sender sender, AMQPSessionContext protonSession, AMQPSessionCallback server, SenderController senderController)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckState()voidclose(boolean remoteLinkClose)voidclose(org.apache.qpid.proton.amqp.transport.ErrorCondition condition)intdeliverMessage(org.apache.activemq.artemis.core.server.MessageReference messageReference, org.apache.activemq.artemis.core.server.ServerConsumer consumer)handle an out going message from ActiveMQ Artemis, send via the Proton Senderprotected voiddoAck(org.apache.activemq.artemis.api.core.Message message)java.lang.ObjectgetBrokerConsumer()protected java.lang.StringgetClientId()org.apache.qpid.proton.engine.SendergetSender()AMQPSessionContextgetSessionContext()booleanhasCredits()voidinitialize()create the actual underlying ActiveMQ Artemis Server ConsumervoidonFlow(int currentCredits, boolean drain)voidonMessage(org.apache.qpid.proton.engine.Delivery delivery)voidreportDrained()Update link state to reflect that the previous drain attempt has completed.ProtonServerSenderContextsetBeforeDelivery(java.util.function.Consumer<? super org.apache.activemq.artemis.core.server.MessageReference> beforeDelivery)voidsettle(org.apache.qpid.proton.engine.Delivery delivery)voidstart()-
Methods inherited from class org.apache.activemq.artemis.protocol.amqp.proton.ProtonInitializable
isInitialized
-
-
-
-
Field Detail
-
protonSession
protected final AMQPSessionContext protonSession
-
sender
protected final org.apache.qpid.proton.engine.Sender sender
-
connection
protected final AMQPConnectionContext connection
-
closed
protected boolean closed
-
sessionSPI
protected final AMQPSessionCallback sessionSPI
-
-
Constructor Detail
-
ProtonServerSenderContext
public ProtonServerSenderContext(AMQPConnectionContext connection, org.apache.qpid.proton.engine.Sender sender, AMQPSessionContext protonSession, AMQPSessionCallback server)
-
ProtonServerSenderContext
public ProtonServerSenderContext(AMQPConnectionContext connection, org.apache.qpid.proton.engine.Sender sender, AMQPSessionContext protonSession, AMQPSessionCallback server, SenderController senderController)
-
-
Method Detail
-
setBeforeDelivery
public ProtonServerSenderContext setBeforeDelivery(java.util.function.Consumer<? super org.apache.activemq.artemis.core.server.MessageReference> beforeDelivery)
-
getBrokerConsumer
public java.lang.Object getBrokerConsumer()
-
onFlow
public void onFlow(int currentCredits, boolean drain)- Specified by:
onFlowin interfaceProtonDeliveryHandler
-
hasCredits
public boolean hasCredits()
-
getSender
public org.apache.qpid.proton.engine.Sender getSender()
-
start
public void start() throws ActiveMQAMQPException- Throws:
ActiveMQAMQPException
-
initialize
public void initialize() throws java.lang.Exceptioncreate the actual underlying ActiveMQ Artemis Server Consumer- Overrides:
initializein classProtonInitializable- Throws:
java.lang.Exception
-
getClientId
protected java.lang.String getClientId()
-
close
public void close(org.apache.qpid.proton.amqp.transport.ErrorCondition condition) throws ActiveMQAMQPException- Specified by:
closein interfaceProtonDeliveryHandler- Throws:
ActiveMQAMQPException
-
close
public void close(boolean remoteLinkClose) throws ActiveMQAMQPException- Specified by:
closein interfaceProtonDeliveryHandler- Throws:
ActiveMQAMQPException
-
onMessage
public void onMessage(org.apache.qpid.proton.engine.Delivery delivery) throws ActiveMQAMQPException- Specified by:
onMessagein interfaceProtonDeliveryHandler- Throws:
ActiveMQAMQPException
-
doAck
protected void doAck(org.apache.activemq.artemis.api.core.Message message) throws ActiveMQAMQPIllegalStateException
-
settle
public void settle(org.apache.qpid.proton.engine.Delivery delivery)
-
checkState
public void checkState()
-
deliverMessage
public int deliverMessage(org.apache.activemq.artemis.core.server.MessageReference messageReference, org.apache.activemq.artemis.core.server.ServerConsumer consumer) throws java.lang.Exceptionhandle an out going message from ActiveMQ Artemis, send via the Proton Sender- Throws:
java.lang.Exception
-
reportDrained
public void reportDrained()
Update link state to reflect that the previous drain attempt has completed.
-
getSessionContext
public AMQPSessionContext getSessionContext()
-
-