Class ProtonEngineHandlerContext
java.lang.Object
org.apache.qpid.protonj2.engine.impl.ProtonEngineHandlerContext
- All Implemented Interfaces:
- EngineHandlerContext
Context for a registered EngineHandler
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intThe context indicator for a handler that wants to be sent all read and write events.static final intThe context indicator for a handler that wants to be sent read events.static final intThe context indicator for a handler that wants to be sent write events.
- 
Constructor SummaryConstructorsConstructorDescriptionProtonEngineHandlerContext(String name, Engine engine, EngineHandler handler) Creates a newProtonEngineHandlerContextwith the given options.
- 
Method SummaryModifier and TypeMethodDescriptionengine()voidFires the engine starting event into the next handler in theEnginePipelinechain.voidFires the engine state changed event into the next handler in theEnginePipelinechain.voidfireFailed(EngineFailedException failure) Fires theEnginefailed event into the next handler in theEnginePipelinechain.voidfireRead(ProtonBuffer buffer) Fires a read of ProtonBuffer events into the previous handler in theEnginePipelinefor further processing.voidfireRead(HeaderEnvelope header) Fires a read of HeaderFrame events into the previous handler in theEnginePipelinefor further processing.voidfireRead(IncomingAMQPEnvelope envelope) Fires a read of IncomingProtocolFrame events into the previous handler in theEnginePipelinefor further processing.voidfireRead(SASLEnvelope envelope) Fires a read of SASL events into the previous handler in theEnginePipelinefor further processing.voidfireWrite(ProtonBuffer buffer, Runnable ioComplete) Fires a write of ProtonBuffer events into the next handler in theEnginePipelinefor further processing.voidfireWrite(HeaderEnvelope envelope) Fires a write of HeaderFrame events into the next handler in theEnginePipelinefor further processing.voidfireWrite(OutgoingAMQPEnvelope envelope) Fires a write ofOutgoingAMQPEnvelopeevents into the next handler in theEnginePipelinefor further processing.voidfireWrite(SASLEnvelope envelope) Fires a write ofSASLEnvelopeevents into the next handler in theEnginePipelinefor further processing.handler()intAllows a handler to indicate if it wants to be notified of a Engine Handler events for specific operations or opt into all engine handler events.interestMask(int mask) Sets the interest mask for this handler context which controls which events should be routed here during normal engine handler pipeline operations.name()
- 
Field Details- 
HANDLER_READSpublic static final int HANDLER_READSThe context indicator for a handler that wants to be sent read events.- See Also:
 
- 
HANDLER_WRITESpublic static final int HANDLER_WRITESThe context indicator for a handler that wants to be sent write events.- See Also:
 
- 
HANDLER_ALL_EVENTSpublic static final int HANDLER_ALL_EVENTSThe context indicator for a handler that wants to be sent all read and write events.- See Also:
 
 
- 
- 
Constructor Details- 
ProtonEngineHandlerContextCreates a newProtonEngineHandlerContextwith the given options.- Parameters:
- name- The name of this- ProtonEngineHandlerContext.
- engine- The engine that this context is assigned to.
- handler- The- EngineHandlerthat this- EngineHandlerContextmanages.
 
 
- 
- 
Method Details- 
handler- Specified by:
- handlerin interface- EngineHandlerContext
- Returns:
- the EngineHandlerthat is associated with the context.
 
- 
name- Specified by:
- namein interface- EngineHandlerContext
- Returns:
- the name that assigned to this EngineHandlerwhen added to theEnginePipeline.
 
- 
engine- Specified by:
- enginein interface- EngineHandlerContext
- Returns:
- the Enginewhere this handler is registered.
 
- 
interestMaskpublic int interestMask()Allows a handler to indicate if it wants to be notified of a Engine Handler events for specific operations or opt into all engine handler events. By opting out of the events that the handler does not process the call chain can be reduced when processing engine events.- Returns:
- the interest mask that should be used to determine if a handler should be signaled.
 
- 
interestMaskSets the interest mask for this handler context which controls which events should be routed here during normal engine handler pipeline operations.- Parameters:
- mask- The interest mask for this- EngineHandlerContext.
- Returns:
- this ProtonEngineHandlerContextinstance.
 
- 
fireEngineStartingpublic void fireEngineStarting()Description copied from interface:EngineHandlerContextFires the engine starting event into the next handler in theEnginePipelinechain.- Specified by:
- fireEngineStartingin interface- EngineHandlerContext
 
- 
fireEngineStateChangedpublic void fireEngineStateChanged()Description copied from interface:EngineHandlerContextFires the engine state changed event into the next handler in theEnginePipelinechain. The state change events occur after the engine starting event and generally signify that the engine has been shutdown normally.- Specified by:
- fireEngineStateChangedin interface- EngineHandlerContext
 
- 
fireFailedDescription copied from interface:EngineHandlerContextFires theEnginefailed event into the next handler in theEnginePipelinechain.- Specified by:
- fireFailedin interface- EngineHandlerContext
- Parameters:
- failure- The exception that describes the conditions under which the engine failed.
 
- 
fireReadDescription copied from interface:EngineHandlerContextFires a read of ProtonBuffer events into the previous handler in theEnginePipelinefor further processing.- Specified by:
- fireReadin interface- EngineHandlerContext
- Parameters:
- buffer- The- ProtonBufferthat carries the bytes read.
 
- 
fireReadDescription copied from interface:EngineHandlerContextFires a read of HeaderFrame events into the previous handler in theEnginePipelinefor further processing.- Specified by:
- fireReadin interface- EngineHandlerContext
- Parameters:
- header- The- HeaderEnvelopethat carries the header bytes read.
 
- 
fireReadDescription copied from interface:EngineHandlerContextFires a read of SASL events into the previous handler in theEnginePipelinefor further processing.- Specified by:
- fireReadin interface- EngineHandlerContext
- Parameters:
- envelope- The- SASLEnvelopethat carries the SASL performative read.
 
- 
fireReadDescription copied from interface:EngineHandlerContextFires a read of IncomingProtocolFrame events into the previous handler in theEnginePipelinefor further processing.- Specified by:
- fireReadin interface- EngineHandlerContext
- Parameters:
- envelope- The- IncomingAMQPEnvelopethat carries the AMQP performative read.
 
- 
fireWriteDescription copied from interface:EngineHandlerContextFires a write ofOutgoingAMQPEnvelopeevents into the next handler in theEnginePipelinefor further processing.- Specified by:
- fireWritein interface- EngineHandlerContext
- Parameters:
- envelope- The- OutgoingAMQPEnvelopethat carries the AMQP performative being written.
 
- 
fireWriteDescription copied from interface:EngineHandlerContextFires a write ofSASLEnvelopeevents into the next handler in theEnginePipelinefor further processing.- Specified by:
- fireWritein interface- EngineHandlerContext
- Parameters:
- envelope- The- SASLEnvelopethat carries the SASL performative being written.
 
- 
fireWriteDescription copied from interface:EngineHandlerContextFires a write of HeaderFrame events into the next handler in theEnginePipelinefor further processing.- Specified by:
- fireWritein interface- EngineHandlerContext
- Parameters:
- envelope- The- HeaderEnvelopethat carries the AMQP Header being written.
 
- 
fireWriteDescription copied from interface:EngineHandlerContextFires a write of ProtonBuffer events into the next handler in theEnginePipelinefor further processing.- Specified by:
- fireWritein interface- EngineHandlerContext
- Parameters:
- buffer- The- ProtonBufferthat carries the bytes being written.
- ioComplete- An optional- Runnablecallback that is signaled when the I/O completes successfully.
 
 
-