|
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 () |
|
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.
|
|
|
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.
|
|
Creates instance of delivery tags that have an empty byte buffer body.
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.
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
-
current | The current system tick count |
- Returns
- the absolute deadline in milliseconds to next call tick by/at, or 0 if there is none
- Exceptions
-
InvalidOperationException | If the engine has already been set to auto tick |
EngineStateException | If the engine has failed or was shutdown |
Implements Apache.Qpid.Proton.Engine.IEngine.