Proton DotNet
Loading...
Searching...
No Matches
Public Member Functions | Properties | List of all members
Apache.Qpid.Proton.Engine.Implementation.ProtonEngine Class Referencesealed

Creates instance of delivery tags that have an empty byte buffer body. More...

Inheritance diagram for Apache.Qpid.Proton.Engine.Implementation.ProtonEngine:
Apache.Qpid.Proton.Engine.IEngine

Public Member Functions

void RegisterSaslDriver (IEngineSaslDriver saslDriver)
 Allows for registration of a custom EngineSaslDriver that will convey SASL state and configuration for this engine.
 
IConnection Start ()
 Starts the engine and returns the Connection instance that is bound to this Engine. A non-started Engine will not allow ingestion of any inbound data and a Connection linked to the engine that was obtained from the engine cannot produce any outbound data.
 
IEngine Shutdown ()
 Shutdown the engine preventing any future outbound or inbound processing.
 
long Tick (long currentTime)
 Prompt the engine to perform idle-timeout/heartbeat handling, and return an absolute deadline in milliseconds that tick must again be called by/at, based on the provided current time in milliseconds, to ensure the periodic work is carried out as necessary. It is an error to call this method if the connection has not been opened. A returned deadline of 0 indicates there is no periodic work necessitating tick be called, e.g. because neither peer has defined an idle-timeout value. The provided milliseconds time values should be derived from a monotonic source such as a system tick counter to prevent wall clock changes leading to erroneous behavior. Note that for some monotonic time sources deadline could be a different sign than the originally given value, and so (if non-zero) the returned deadline should have the current time originally provided subtracted from it in order to establish a relative time delay to the next deadline.
 
IEngine TickAuto (TaskFactory taskFactory)
 Allows the engine to manage idle timeout processing by providing it the single threaded task scheduler where all transport work is done which ensures singled threaded access while removing the need for the client library or server application to manage calls to the tick processing methods.
 
IEngine Ingest (IProtonBuffer input)
 Provide data input for this Engine from some external source. If the engine is not writable when this method is called an EngineNotWritableException will be thrown unless the reason for the not writable state is due to engine failure or the engine already having been shut down in which case the appropriate EngineStateException will be thrown to indicate the reason.
 
EngineStateException EngineFailed (Exception cause)
 Transition the Engine to a failed state if not already closed or closing.
 
IEngine ErrorHandler (Action< IEngine > handler)
 Sets a handler instance that will be notified when the engine encounters a fatal error.
 
IEngine OutputHandler (Action< IProtonBuffer, Action > handler)
 Sets a Action instance that will be notified when data from the engine is ready to be written to some output sink (socket etc). The Action value provided to the handler (if non-null) should be invoked once the I/O operation has completely successfully. In the event of an error writing the data the handler should throw an error or if performed asynchronously the Engine should be marked failed via a call to the engine failed API.
 
IEngine ShutdownHandler (Action< IEngine > handler)
 Sets a handler instance that will be notified when the engine is shut down via a call to the engine shutdown method.
 
void RunIdleTimeoutTask ()
 
- Public Member Functions inherited from Apache.Qpid.Proton.Engine.IEngine
IEngine Ingest (byte[] input)
 Provide data input for this Engine from some external source. If the engine is not writable when this method is called an EngineNotWritableException will be thrown unless the reason for the not writable state is due to engine failure or the engine already having been shut down in which case the appropriate EngineStateException will be thrown to indicate the reason.
 
IEngine OutputHandler (Action< IProtonBuffer > handler)
 Sets a Action instance that will be notified when data from the engine is ready to be written to some output sink (socket etc). In the event of an error writing the data the handler should throw an error or if performed asynchronously the Engine should be marked failed via a call to the engine failed API.
 

Properties

IConnection Connection [get]
 Gets the Connection instance that is associated with this Engine instance. It is valid for an engine implementation to not return a Connection instance prior to the engine having been started although it is recommended that one be available immediately to prevent confusion.
 
bool IsFailed [get]
 Checks if the engine has entered a failed state either by a call to the engine failed method or by an exception having been thrown and caught. An engine that reports failed will stop after a call to shutdown.
 
bool IsRunning [get]
 Checks if the engine is in the running state and has not failed or been shutdown yet. Will return false until start is called on the engine.
 
bool IsShutdown [get]
 Checks if the engine has been shutdown which is a terminal state after which no future engine state changes can occur.
 
bool IsWritable [get]
 Returns true if the engine is accepting input from the ingestion entry points.
 
Exception FailureCause [get]
 Provides an Exception that has information regarding the cause of an engine entering the failed state.
 
EngineState EngineState [get]
 Provides the current engine operating state.
 
IEngineConfiguration Configuration [get]
 Provides access to the configuration object associated with this engine.
 
IEnginePipeline Pipeline [get]
 Provides access to the engine pipeline instance associated with this engine.
 
IEngineSaslDriver SaslDriver [get]
 Provides access to the SASL driver that is assigned to this engine.
 
- Properties inherited from Apache.Qpid.Proton.Engine.IEngine

Detailed Description

Creates instance of delivery tags that have an empty byte buffer body.

Member Function Documentation

◆ EngineFailed()

EngineStateException Apache.Qpid.Proton.Engine.Implementation.ProtonEngine.EngineFailed ( Exception  cause)
inline

Transition the Engine to a failed state if not already closed or closing.

If called when the engine has not failed the engine will be transitioned to the failed state and the method will return an appropriate EngineFailedException that wraps the given cause. If called after the engine was shutdown the method returns an EngineShutdownException indicating that the engine was already shutdown. Repeated calls to this method while the engine is in the failed state must not alter the original failure error or elicit new engine failed event notifications.

Parameters
causeThe exception that led to the Engine being failed
Returns
The exception that caused the engine to be transitioned to the failed state

Implements Apache.Qpid.Proton.Engine.IEngine.

◆ ErrorHandler()

IEngine Apache.Qpid.Proton.Engine.Implementation.ProtonEngine.ErrorHandler ( Action< IEngine handler)
inline

Sets a handler instance that will be notified when the engine encounters a fatal error.

Parameters
handlerThe handler that will be invoked on an engine error state
Returns
This engine instance
Exceptions
EngineStateExceptionIf the engine has failed or was shutdown

Implements Apache.Qpid.Proton.Engine.IEngine.

◆ Ingest()

IEngine Apache.Qpid.Proton.Engine.Implementation.ProtonEngine.Ingest ( IProtonBuffer  input)
inline

Provide data input for this Engine from some external source. If the engine is not writable when this method is called an EngineNotWritableException will be thrown unless the reason for the not writable state is due to engine failure or the engine already having been shut down in which case the appropriate EngineStateException will be thrown to indicate the reason.

Parameters
inputThe binary data to ingest into the engine
Returns
This Engine instance
Exceptions
EngineNotWritableExceptionIf the engine is not currently accepting input
EngineStateExceptionIf the engine state is already failed or shutdown

Implements Apache.Qpid.Proton.Engine.IEngine.

◆ OutputHandler()

IEngine Apache.Qpid.Proton.Engine.Implementation.ProtonEngine.OutputHandler ( Action< IProtonBuffer, Action >  handler)
inline

Sets a Action instance that will be notified when data from the engine is ready to be written to some output sink (socket etc). The Action value provided to the handler (if non-null) should be invoked once the I/O operation has completely successfully. In the event of an error writing the data the handler should throw an error or if performed asynchronously the Engine should be marked failed via a call to the engine failed API.

Parameters
handlerThe delegate that will be invoked when engine output is available
Returns
This engine instance
Exceptions
EngineStateExceptionIf the engine has failed or was shutdown

Implements Apache.Qpid.Proton.Engine.IEngine.

◆ RegisterSaslDriver()

void Apache.Qpid.Proton.Engine.Implementation.ProtonEngine.RegisterSaslDriver ( IEngineSaslDriver  saslDriver)
inline

Allows for registration of a custom EngineSaslDriver that will convey SASL state and configuration for this engine.

Parameters
saslDriverThe SASL driver that this engine should use.
Exceptions
EngineStateExceptionIf the engine has already been shutdown or failed
EngineStartedExceptionIf the engine has already been started

◆ Shutdown()

IEngine Apache.Qpid.Proton.Engine.Implementation.ProtonEngine.Shutdown ( )
inline

Shutdown the engine preventing any future outbound or inbound processing.

When the engine is shut down any resources, Connection, Session or Link instances that have an engine shutdown event handler registered will be notified and should react by locally closing that resource if they wish to ensure that the resource's local close event handler gets signaled if that resource is not already locally closed.

Returns
This Engine instance

Implements Apache.Qpid.Proton.Engine.IEngine.

◆ ShutdownHandler()

IEngine Apache.Qpid.Proton.Engine.Implementation.ProtonEngine.ShutdownHandler ( Action< IEngine handler)
inline

Sets a handler instance that will be notified when the engine is shut down via a call to the engine shutdown method.

Parameters
handlerThe handler that will be signalled on engine shutdown
Returns
This engine instance
Exceptions
EngineStateExceptionIf the engine has failed or was shutdown

Implements Apache.Qpid.Proton.Engine.IEngine.

◆ Start()

IConnection Apache.Qpid.Proton.Engine.Implementation.ProtonEngine.Start ( )
inline

Starts the engine and returns the Connection instance that is bound to this Engine. A non-started Engine will not allow ingestion of any inbound data and a Connection linked to the engine that was obtained from the engine cannot produce any outbound data.

Returns
The Connection that is linked to the engine instance
Exceptions
EngineStateExceptionIf the engine state is already failed or shutdown

Implements Apache.Qpid.Proton.Engine.IEngine.

◆ Tick()

long Apache.Qpid.Proton.Engine.Implementation.ProtonEngine.Tick ( long  current)
inline

Prompt the engine to perform idle-timeout/heartbeat handling, and return an absolute deadline in milliseconds that tick must again be called by/at, based on the provided current time in milliseconds, to ensure the periodic work is carried out as necessary. It is an error to call this method if the connection has not been opened. A returned deadline of 0 indicates there is no periodic work necessitating tick be called, e.g. because neither peer has defined an idle-timeout value. The provided milliseconds time values should be derived from a monotonic source such as a system tick counter to prevent wall clock changes leading to erroneous behavior. Note that for some monotonic time sources deadline could be a different sign than the originally given value, and so (if non-zero) the returned deadline should have the current time originally provided subtracted from it in order to establish a relative time delay to the next deadline.

Parameters
currentThe current system tick count
Returns
the absolute deadline in milliseconds to next call tick by/at, or 0 if there is none
Exceptions
InvalidOperationExceptionIf the engine has already been set to auto tick
EngineStateExceptionIf the engine has failed or was shutdown

Implements Apache.Qpid.Proton.Engine.IEngine.

◆ TickAuto()

IEngine Apache.Qpid.Proton.Engine.Implementation.ProtonEngine.TickAuto ( TaskFactory  taskFactory)
inline

Allows the engine to manage idle timeout processing by providing it the single threaded task scheduler where all transport work is done which ensures singled threaded access while removing the need for the client library or server application to manage calls to the tick processing methods.

Parameters
taskFactoryThe single threaded task factory where are engine work is queued
Returns
This engine instance
Exceptions
EngineStateExceptionIf the engine has failed or was shutdown

Implements Apache.Qpid.Proton.Engine.IEngine.

Property Documentation

◆ Configuration

IEngineConfiguration Apache.Qpid.Proton.Engine.Implementation.ProtonEngine.Configuration
get

Provides access to the configuration object associated with this engine.

Implements Apache.Qpid.Proton.Engine.IEngine.

◆ Connection

IConnection Apache.Qpid.Proton.Engine.Implementation.ProtonEngine.Connection
get

Gets the Connection instance that is associated with this Engine instance. It is valid for an engine implementation to not return a Connection instance prior to the engine having been started although it is recommended that one be available immediately to prevent confusion.

Implements Apache.Qpid.Proton.Engine.IEngine.

◆ EngineState

EngineState Apache.Qpid.Proton.Engine.Implementation.ProtonEngine.EngineState
get

Provides the current engine operating state.

Implements Apache.Qpid.Proton.Engine.IEngine.

◆ FailureCause

Exception Apache.Qpid.Proton.Engine.Implementation.ProtonEngine.FailureCause
get

Provides an Exception that has information regarding the cause of an engine entering the failed state.

Implements Apache.Qpid.Proton.Engine.IEngine.

◆ IsFailed

bool Apache.Qpid.Proton.Engine.Implementation.ProtonEngine.IsFailed
get

Checks if the engine has entered a failed state either by a call to the engine failed method or by an exception having been thrown and caught. An engine that reports failed will stop after a call to shutdown.

Returns
true if the engine is in a failed state

Implements Apache.Qpid.Proton.Engine.IEngine.

◆ IsRunning

bool Apache.Qpid.Proton.Engine.Implementation.ProtonEngine.IsRunning
get

Checks if the engine is in the running state and has not failed or been shutdown yet. Will return false until start is called on the engine.

Returns
true if the engine is currently running.

Implements Apache.Qpid.Proton.Engine.IEngine.

◆ IsShutdown

bool Apache.Qpid.Proton.Engine.Implementation.ProtonEngine.IsShutdown
get

Checks if the engine has been shutdown which is a terminal state after which no future engine state changes can occur.

Returns

Implements Apache.Qpid.Proton.Engine.IEngine.

◆ IsWritable

bool Apache.Qpid.Proton.Engine.Implementation.ProtonEngine.IsWritable
get

Returns true if the engine is accepting input from the ingestion entry points.

When false any attempts to write more data into the engine will result in an error being returned from the write operation. An engine that has not been started or that has been failed or shutdown will report as not writable.

Implements Apache.Qpid.Proton.Engine.IEngine.

◆ Pipeline

IEnginePipeline Apache.Qpid.Proton.Engine.Implementation.ProtonEngine.Pipeline
get

Provides access to the engine pipeline instance associated with this engine.

Implements Apache.Qpid.Proton.Engine.IEngine.

◆ SaslDriver

IEngineSaslDriver Apache.Qpid.Proton.Engine.Implementation.ProtonEngine.SaslDriver
get

Provides access to the SASL driver that is assigned to this engine.

Implements Apache.Qpid.Proton.Engine.IEngine.


The documentation for this class was generated from the following file: