Interface IAppLifecycleBehavior
Singleton service contract for application lifecycle behavior.
Namespace: Kephas.Application
Assembly: Kephas.Core.dll
Syntax
[SingletonAppServiceContract(AllowMultiple = true)]
public interface IAppLifecycleBehavior
Remarks
An application lifecycle behavior intercepts the initialization and finalization of the application and reacts to them.
Methods
| Improve this Doc View SourceAfterAppFinalizeAsync(IContext, CancellationToken)
Interceptor called after the application completes its asynchronous finalization.
Declaration
Task AfterAppFinalizeAsync(IContext appContext, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
IContext | appContext | Context for the application. |
System.Threading.CancellationToken | cancellationToken | Optional. The cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A Task. |
AfterAppInitializeAsync(IContext, CancellationToken)
Interceptor called after the application completes its asynchronous initialization.
Declaration
Task AfterAppInitializeAsync(IContext appContext, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
IContext | appContext | Context for the application. |
System.Threading.CancellationToken | cancellationToken | Optional. The cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | The asynchronous result. |
BeforeAppFinalizeAsync(IContext, CancellationToken)
Interceptor called before the application starts its asynchronous finalization.
Declaration
Task BeforeAppFinalizeAsync(IContext appContext, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
IContext | appContext | Context for the application. |
System.Threading.CancellationToken | cancellationToken | Optional. The cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A Task. |
Remarks
To interrupt finalization, simply throw any appropriate exception. Caution! Interrupting the finalization may cause the application to remain in an undefined state.
BeforeAppInitializeAsync(IContext, CancellationToken)
Interceptor called before the application starts its asynchronous initialization.
Declaration
Task BeforeAppInitializeAsync(IContext appContext, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
IContext | appContext | Context for the application. |
System.Threading.CancellationToken | cancellationToken | Optional. The cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | The asynchronous result. |
Remarks
To interrupt the application initialization, simply throw an appropriate exception.