Interface IFeatureLifecycleBehavior
Singleton service contract for feature lifecycle behaviors.
Namespace: Kephas.Application
Assembly: Kephas.Application.dll
Syntax
[SingletonAppServiceContract(AllowMultiple = true, MetadataAttributes = new Type[]{typeof(TargetFeatureAttribute)})]
public interface IFeatureLifecycleBehavior
Remarks
A feature lifecycle behavior intercepts the initialization and finalization of one or more features and reacts to them. Such features could log the performance of initialization, check prerequisites like proper licensing or whatever the application needs.
Methods
| Improve this Doc View SourceAfterFinalizeAsync(IAppContext, FeatureManagerMetadata, CancellationToken)
Interceptor called after a feature completes its asynchronous finalization.
Declaration
Task AfterFinalizeAsync(IAppContext appContext, FeatureManagerMetadata serviceMetadata, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
IAppContext | appContext | Context for the application. |
FeatureManagerMetadata | serviceMetadata | The feature manager service metadata. |
System.Threading.CancellationToken | cancellationToken | The cancellation token (optional). |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A Task. |
AfterInitializeAsync(IAppContext, FeatureManagerMetadata, CancellationToken)
Interceptor called after a feature completes its asynchronous initialization.
Declaration
Task AfterInitializeAsync(IAppContext appContext, FeatureManagerMetadata serviceMetadata, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
IAppContext | appContext | Context for the application. |
FeatureManagerMetadata | serviceMetadata | The feature manager service metadata. |
System.Threading.CancellationToken | cancellationToken | The cancellation token (optional). |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A Task. |
BeforeFinalizeAsync(IAppContext, FeatureManagerMetadata, CancellationToken)
Interceptor called before a feature starts its asynchronous finalization.
Declaration
Task BeforeFinalizeAsync(IAppContext appContext, FeatureManagerMetadata serviceMetadata, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
IAppContext | appContext | Context for the application. |
FeatureManagerMetadata | serviceMetadata | The feature manager service metadata. |
System.Threading.CancellationToken | cancellationToken | The cancellation token (optional). |
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.
BeforeInitializeAsync(IAppContext, FeatureManagerMetadata, CancellationToken)
Interceptor called before a feature starts its asynchronous initialization.
Declaration
Task BeforeInitializeAsync(IAppContext appContext, FeatureManagerMetadata serviceMetadata, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
IAppContext | appContext | Context for the application. |
FeatureManagerMetadata | serviceMetadata | The feature manager service metadata. |
System.Threading.CancellationToken | cancellationToken | The cancellation token (optional). |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A Task. |
Remarks
To interrupt the feature initialization, simply throw an appropriate exception.