Class ProtonEngineHandlerContext
java.lang.Object
org.apache.qpid.protonj2.engine.impl.ProtonEngineHandlerContext
- All Implemented Interfaces:
EngineHandlerContext
Context for a registered EngineHandler
-
Field Summary
FieldsModifier 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 Summary
ConstructorsConstructorDescriptionProtonEngineHandlerContext(String name, Engine engine, EngineHandler handler) Creates a newProtonEngineHandlerContextwith the given options. -
Method Summary
Modifier 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_READS
public static final int HANDLER_READSThe context indicator for a handler that wants to be sent read events.- See Also:
-
HANDLER_WRITES
public static final int HANDLER_WRITESThe context indicator for a handler that wants to be sent write events.- See Also:
-
HANDLER_ALL_EVENTS
public 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
-
ProtonEngineHandlerContext
Creates a newProtonEngineHandlerContextwith the given options.- Parameters:
name- The name of thisProtonEngineHandlerContext.engine- The engine that this context is assigned to.handler- TheEngineHandlerthat thisEngineHandlerContextmanages.
-
-
Method Details
-
handler
- Specified by:
handlerin interfaceEngineHandlerContext- Returns:
- the
EngineHandlerthat is associated with the context.
-
name
- Specified by:
namein interfaceEngineHandlerContext- Returns:
- the name that assigned to this
EngineHandlerwhen added to theEnginePipeline.
-
engine
- Specified by:
enginein interfaceEngineHandlerContext- Returns:
- the
Enginewhere this handler is registered.
-
interestMask
public 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.
-
interestMask
Sets 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 thisEngineHandlerContext.- Returns:
- this
ProtonEngineHandlerContextinstance.
-
fireEngineStarting
public void fireEngineStarting()Description copied from interface:EngineHandlerContextFires the engine starting event into the next handler in theEnginePipelinechain.- Specified by:
fireEngineStartingin interfaceEngineHandlerContext
-
fireEngineStateChanged
public 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 interfaceEngineHandlerContext
-
fireFailed
Description copied from interface:EngineHandlerContextFires theEnginefailed event into the next handler in theEnginePipelinechain.- Specified by:
fireFailedin interfaceEngineHandlerContext- Parameters:
failure- The exception that describes the conditions under which the engine failed.
-
fireRead
Description copied from interface:EngineHandlerContextFires a read of ProtonBuffer events into the previous handler in theEnginePipelinefor further processing.- Specified by:
fireReadin interfaceEngineHandlerContext- Parameters:
buffer- TheProtonBufferthat carries the bytes read.
-
fireRead
Description copied from interface:EngineHandlerContextFires a read of HeaderFrame events into the previous handler in theEnginePipelinefor further processing.- Specified by:
fireReadin interfaceEngineHandlerContext- Parameters:
header- TheHeaderEnvelopethat carries the header bytes read.
-
fireRead
Description copied from interface:EngineHandlerContextFires a read of SASL events into the previous handler in theEnginePipelinefor further processing.- Specified by:
fireReadin interfaceEngineHandlerContext- Parameters:
envelope- TheSASLEnvelopethat carries the SASL performative read.
-
fireRead
Description copied from interface:EngineHandlerContextFires a read of IncomingProtocolFrame events into the previous handler in theEnginePipelinefor further processing.- Specified by:
fireReadin interfaceEngineHandlerContext- Parameters:
envelope- TheIncomingAMQPEnvelopethat carries the AMQP performative read.
-
fireWrite
Description copied from interface:EngineHandlerContextFires a write ofOutgoingAMQPEnvelopeevents into the next handler in theEnginePipelinefor further processing.- Specified by:
fireWritein interfaceEngineHandlerContext- Parameters:
envelope- TheOutgoingAMQPEnvelopethat carries the AMQP performative being written.
-
fireWrite
Description copied from interface:EngineHandlerContextFires a write ofSASLEnvelopeevents into the next handler in theEnginePipelinefor further processing.- Specified by:
fireWritein interfaceEngineHandlerContext- Parameters:
envelope- TheSASLEnvelopethat carries the SASL performative being written.
-
fireWrite
Description copied from interface:EngineHandlerContextFires a write of HeaderFrame events into the next handler in theEnginePipelinefor further processing.- Specified by:
fireWritein interfaceEngineHandlerContext- Parameters:
envelope- TheHeaderEnvelopethat carries the AMQP Header being written.
-
fireWrite
Description copied from interface:EngineHandlerContextFires a write of ProtonBuffer events into the next handler in theEnginePipelinefor further processing.- Specified by:
fireWritein interfaceEngineHandlerContext- Parameters:
buffer- TheProtonBufferthat carries the bytes being written.ioComplete- An optionalRunnablecallback that is signaled when the I/O completes successfully.
-