Class ProtonEnginePipelineProxy
java.lang.Object
org.apache.qpid.protonj2.engine.impl.ProtonEnginePipelineProxy
- All Implemented Interfaces:
- EnginePipeline
Wrapper around the internal 
ProtonEnginePipeline used to present a guarded
 pipeline to the outside world when the Engine.pipeline() method is used
 to gain access to the pipeline.  The proxy will ensure that any read or write
 calls enforce Engine state such as not started and shutdown.- 
Method SummaryModifier and TypeMethodDescriptionaddFirst(String name, EngineHandler handler) Adds the given handler to the front of the pipeline with the given name stored for later lookup or remove operations.addLast(String name, EngineHandler handler) Adds the given handler to the end of the pipeline with the given name stored for later lookup or remove operations.engine()Finds and returns first handler that is found in the pipeline that matches the given name.Fires an engine starting event to each handler in the pipeline.Fires an engine state changed event to each handler in the pipeline.Fires an engine failed event into eachEngineHandlerin the pipeline indicating that the engine is now failed and should not accept or produce new work.fireRead(ProtonBuffer input) Fires a read event consisting of the givenProtonBufferinto the pipeline starting from the lastEngineHandlerin the pipeline and moving through each until the incoming work is fully processed.fireRead(HeaderEnvelope header) Fires a read event consisting of the givenHeaderEnvelopeinto the pipeline starting from the lastEngineHandlerin the pipeline and moving through each until the incoming work is fully processed.fireRead(IncomingAMQPEnvelope envelope) Fires a read event consisting of the givenIncomingAMQPEnvelopeinto the pipeline starting from the lastEngineHandlerin the pipeline and moving through each until the incoming work is fully processed.fireRead(SASLEnvelope envelope) Fires a read event consisting of the givenSASLEnvelopeinto the pipeline starting from the lastEngineHandlerin the pipeline and moving through each until the incoming work is fully processed.fireWrite(ProtonBuffer buffer, Runnable ioComplete) Fires a write event consisting of the givenProtonBufferinto the pipeline starting from the firstEngineHandlerin the pipeline and moving through each until the outgoing work is fully processed.fireWrite(HeaderEnvelope envelope) Fires a write event consisting of the givenHeaderEnvelopeinto the pipeline starting from the firstEngineHandlerin the pipeline and moving through each until the outgoing work is fully processed.fireWrite(OutgoingAMQPEnvelope envelope) Fires a write event consisting of the givenOutgoingAMQPEnvelopeinto the pipeline starting from the firstEngineHandlerin the pipeline and moving through each until the outgoing work is fully processed.fireWrite(SASLEnvelope envelope) Fires a write event consisting of the givenSASLEnvelopeinto the pipeline starting from the firstEngineHandlerin the pipeline and moving through each until the outgoing work is fully processed.first()last()Removes the first handler that is found in the pipeline that matches the given name.remove(EngineHandler handler) Removes the givenEngineHandlerfrom the pipeline if present.Removes the firstEngineHandlerin the pipeline.Removes the lastEngineHandlerin the pipeline.
- 
Method Details- 
engine- Specified by:
- enginein interface- EnginePipeline
- Returns:
- the Enginethat this pipeline is linked to.
 
- 
addFirstDescription copied from interface:EnginePipelineAdds the given handler to the front of the pipeline with the given name stored for later lookup or remove operations. It is not mandatory that each handler have unique names although if handlers do share a name theEnginePipeline.remove(String)method will only remove them one at a time starting from the first in the pipeline.- Specified by:
- addFirstin interface- EnginePipeline
- Parameters:
- name- The name to assign to the handler
- handler- The- EngineHandlerto add into the pipeline.
- Returns:
- this EnginePipeline.
 
- 
addLastDescription copied from interface:EnginePipelineAdds the given handler to the end of the pipeline with the given name stored for later lookup or remove operations. It is not mandatory that each handler have unique names although if handlers do share a name theEnginePipeline.remove(String)method will only remove them one at a time starting from the first in the pipeline.- Specified by:
- addLastin interface- EnginePipeline
- Parameters:
- name- The name to assign to the handler
- handler- The- EngineHandlerto add into the pipeline.
- Returns:
- this EnginePipeline.
 
- 
removeFirstDescription copied from interface:EnginePipelineRemoves the firstEngineHandlerin the pipeline.- Specified by:
- removeFirstin interface- EnginePipeline
- Returns:
- this EnginePipeline.
 
- 
removeLastDescription copied from interface:EnginePipelineRemoves the lastEngineHandlerin the pipeline.- Specified by:
- removeLastin interface- EnginePipeline
- Returns:
- this EnginePipeline.
 
- 
removeDescription copied from interface:EnginePipelineRemoves the first handler that is found in the pipeline that matches the given name.- Specified by:
- removein interface- EnginePipeline
- Parameters:
- name- The name to search for in the pipeline moving from first to last.
- Returns:
- this EnginePipeline.
 
- 
removeDescription copied from interface:EnginePipelineRemoves the givenEngineHandlerfrom the pipeline if present.- Specified by:
- removein interface- EnginePipeline
- Parameters:
- handler- The handler instance to remove if contained in the pipeline.
- Returns:
- this EnginePipeline.
 
- 
findDescription copied from interface:EnginePipelineFinds and returns first handler that is found in the pipeline that matches the given name.- Specified by:
- findin interface- EnginePipeline
- Parameters:
- name- The name to search for in the pipeline moving from first to last.
- Returns:
- the EngineHandlerthat matches the given name or null if none in the pipeline.
 
- 
first- Specified by:
- firstin interface- EnginePipeline
- Returns:
- the first EngineHandlerin the pipeline or null if empty.
 
- 
last- Specified by:
- lastin interface- EnginePipeline
- Returns:
- the last EngineHandlerin the pipeline or null if empty.
 
- 
firstContext- Specified by:
- firstContextin interface- EnginePipeline
- Returns:
- the first EngineHandlerContextin the pipeline or null if empty.
 
- 
lastContext- Specified by:
- lastContextin interface- EnginePipeline
- Returns:
- the last EngineHandlerContextin the pipeline or null if empty.
 
- 
fireEngineStartingDescription copied from interface:EnginePipelineFires an engine starting event to each handler in the pipeline. Should be used by the engine implementation to signal its handlers that they should initialize.- Specified by:
- fireEngineStartingin interface- EnginePipeline
- Returns:
- this EnginePipeline.
 
- 
fireEngineStateChangedDescription copied from interface:EnginePipelineFires an engine state changed event to each handler in the pipeline. Should be used by the engine implementation to signal its handlers that they should respond to the new engine state, e.g. the engine failed or was shutdown.- Specified by:
- fireEngineStateChangedin interface- EnginePipeline
- Returns:
- this EnginePipeline.
 
- 
fireFailedDescription copied from interface:EnginePipelineFires an engine failed event into eachEngineHandlerin the pipeline indicating that the engine is now failed and should not accept or produce new work.- Specified by:
- fireFailedin interface- EnginePipeline
- Parameters:
- e- The cause of the engine failure.
- Returns:
- this EnginePipeline.
 
- 
fireReadDescription copied from interface:EnginePipelineFires a read event consisting of the givenProtonBufferinto the pipeline starting from the lastEngineHandlerin the pipeline and moving through each until the incoming work is fully processed. If the read events reaches the head of the pipeline and is not handled by any handler an error is thrown and the engine should enter the failed state.- Specified by:
- fireReadin interface- EnginePipeline
- Parameters:
- input- The- ProtonBufferto inject into the engine pipeline.
- Returns:
- this EnginePipeline.
 
- 
fireReadDescription copied from interface:EnginePipelineFires a read event consisting of the givenHeaderEnvelopeinto the pipeline starting from the lastEngineHandlerin the pipeline and moving through each until the incoming work is fully processed. If the read events reaches the head of the pipeline and is not handled by any handler an error is thrown and the engine should enter the failed state.- Specified by:
- fireReadin interface- EnginePipeline
- Parameters:
- header- The- HeaderEnvelopeto inject into the engine pipeline.
- Returns:
- this EnginePipeline.
 
- 
fireReadDescription copied from interface:EnginePipelineFires a read event consisting of the givenSASLEnvelopeinto the pipeline starting from the lastEngineHandlerin the pipeline and moving through each until the incoming work is fully processed. If the read events reaches the head of the pipeline and is not handled by any handler an error is thrown and the engine should enter the failed state.- Specified by:
- fireReadin interface- EnginePipeline
- Parameters:
- envelope- The- SASLEnvelopeto inject into the engine pipeline.
- Returns:
- this EnginePipeline.
 
- 
fireReadDescription copied from interface:EnginePipelineFires a read event consisting of the givenIncomingAMQPEnvelopeinto the pipeline starting from the lastEngineHandlerin the pipeline and moving through each until the incoming work is fully processed. If the read events reaches the head of the pipeline and is not handled by any handler an error is thrown and the engine should enter the failed state.- Specified by:
- fireReadin interface- EnginePipeline
- Parameters:
- envelope- The- IncomingAMQPEnvelopeto inject into the engine pipeline.
- Returns:
- this EnginePipeline.
 
- 
fireWriteDescription copied from interface:EnginePipelineFires a write event consisting of the givenHeaderEnvelopeinto the pipeline starting from the firstEngineHandlerin the pipeline and moving through each until the outgoing work is fully processed. If the write events reaches the tail of the pipeline and is not handled by any handler an error is thrown and the engine should enter the failed state. It is expected that after the fire write method returns the givenHeaderEnvelopewill have been written or if held for later the object must be copied.- Specified by:
- fireWritein interface- EnginePipeline
- Parameters:
- envelope- The- HeaderEnvelopeto inject into the engine pipeline.
- Returns:
- this EnginePipeline.
 
- 
fireWriteDescription copied from interface:EnginePipelineFires a write event consisting of the givenOutgoingAMQPEnvelopeinto the pipeline starting from the firstEngineHandlerin the pipeline and moving through each until the outgoing work is fully processed. If the write events reaches the tail of the pipeline and is not handled by any handler an error is thrown and the engine should enter the failed state. It is expected that after the fire write method returns the givenOutgoingAMQPEnvelopewill have been written or if held for later the object must be copied. When the payload given exceeds the maximum allowed frame size when encoded into an outbound frame the encoding handler should either throw an error in the case that the performative being written cannot truncate its payload or should invoke the payload to large handler of the envelope before re-encoding the outbound performative and truncating the payload.- Specified by:
- fireWritein interface- EnginePipeline
- Parameters:
- envelope- The- OutgoingAMQPEnvelopeto inject into the engine pipeline.
- Returns:
- this EnginePipeline.
 
- 
fireWriteDescription copied from interface:EnginePipelineFires a write event consisting of the givenSASLEnvelopeinto the pipeline starting from the firstEngineHandlerin the pipeline and moving through each until the outgoing work is fully processed. If the write events reaches the tail of the pipeline and is not handled by any handler an error is thrown and the engine should enter the failed state. It is expected that after the fire write method returns the givenSASLEnvelopewill have been written or if held for later the object must be copied.- Specified by:
- fireWritein interface- EnginePipeline
- Parameters:
- envelope- The- SASLEnvelopeto inject into the engine pipeline.
- Returns:
- this EnginePipeline.
 
- 
fireWriteDescription copied from interface:EnginePipelineFires a write event consisting of the givenProtonBufferinto the pipeline starting from the firstEngineHandlerin the pipeline and moving through each until the outgoing work is fully processed. If the write events reaches the tail of the pipeline and is not handled by any handler an error is thrown and the engine should enter the failed state.- Specified by:
- fireWritein interface- EnginePipeline
- Parameters:
- buffer- The- ProtonBufferto inject into the engine pipeline.
- ioComplete- An optional callback that should be signaled when the underlying transport complete the I/O write
- Returns:
- this EnginePipeline.
 
 
-