Class DefaultAppManager
The default application manager.
Inherited Members
Namespace: Kephas.Application
Assembly: Kephas.Application.dll
Syntax
[OverridePriority(Priority.Low)]
public class DefaultAppManager : Loggable, ILoggable, IAppManager
Constructors
| Improve this Doc View SourceDefaultAppManager(IAppRuntime, ICompositionContext, IServiceBehaviorProvider, ICollection<IExportFactory<IAppLifecycleBehavior, AppServiceMetadata>>, ICollection<IExportFactory<IFeatureManager, FeatureManagerMetadata>>, ICollection<IExportFactory<IFeatureLifecycleBehavior, FeatureLifecycleBehaviorMetadata>>)
Initializes a new instance of the DefaultAppManager class.
Declaration
public DefaultAppManager(IAppRuntime appRuntime, ICompositionContext compositionContext, IServiceBehaviorProvider serviceBehaviorProvider = null, ICollection<IExportFactory<IAppLifecycleBehavior, AppServiceMetadata>> appLifecycleBehaviorFactories = null, ICollection<IExportFactory<IFeatureManager, FeatureManagerMetadata>> featureManagerFactories = null, ICollection<IExportFactory<IFeatureLifecycleBehavior, FeatureLifecycleBehaviorMetadata>> featureLifecycleBehaviorFactories = null)
Parameters
Type | Name | Description |
---|---|---|
IAppRuntime | appRuntime | The application runtime. |
ICompositionContext | compositionContext | The ambient services. |
IServiceBehaviorProvider | serviceBehaviorProvider | Optional. The service behavior provider. |
System.Collections.Generic.ICollection<IExportFactory<IAppLifecycleBehavior, AppServiceMetadata>> | appLifecycleBehaviorFactories | Optional. The application lifecycle behavior factories. |
System.Collections.Generic.ICollection<IExportFactory<IFeatureManager, FeatureManagerMetadata>> | featureManagerFactories | Optional. The feature manager factories. |
System.Collections.Generic.ICollection<IExportFactory<IFeatureLifecycleBehavior, FeatureLifecycleBehaviorMetadata>> | featureLifecycleBehaviorFactories | Optional. The feature lifecycle behavior factories. |
Properties
| Improve this Doc View SourceAppLifecycleBehaviorFactories
Gets the application lifecycle behavior factories.
Declaration
public ICollection<IExportFactory<IAppLifecycleBehavior, AppServiceMetadata>> AppLifecycleBehaviorFactories { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.ICollection<IExportFactory<IAppLifecycleBehavior, AppServiceMetadata>> | The application lifecycle behavior factories. |
AppRuntime
Gets the application runtime.
Declaration
public IAppRuntime AppRuntime { get; }
Property Value
Type | Description |
---|---|
IAppRuntime |
CompositionContext
Gets the composition context.
Declaration
public ICompositionContext CompositionContext { get; }
Property Value
Type | Description |
---|---|
ICompositionContext | The composition context. |
FeatureLifecycleBehaviorFactories
Gets the feature lifecycle behavior factories.
Declaration
public ICollection<IExportFactory<IFeatureLifecycleBehavior, FeatureLifecycleBehaviorMetadata>> FeatureLifecycleBehaviorFactories { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.ICollection<IExportFactory<IFeatureLifecycleBehavior, FeatureLifecycleBehaviorMetadata>> | The feature lifecycle behavior factories. |
FeatureManagerFactories
Gets the feature manager factories.
Declaration
public ICollection<IExportFactory<IFeatureManager, FeatureManagerMetadata>> FeatureManagerFactories { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.ICollection<IExportFactory<IFeatureManager, FeatureManagerMetadata>> | The feature manager factories. |
ServiceBehaviorProvider
Gets the service behavior provider.
Declaration
public IServiceBehaviorProvider ServiceBehaviorProvider { get; }
Property Value
Type | Description |
---|---|
IServiceBehaviorProvider |
Methods
| Improve this Doc View SourceAfterAppFinalizeAsync(ICollection<IExport<IAppLifecycleBehavior, AppServiceMetadata>>, IAppContext, CancellationToken)
Overridable method called after the application was finalized.
Declaration
protected virtual Task AfterAppFinalizeAsync(ICollection<IExport<IAppLifecycleBehavior, AppServiceMetadata>> behaviors, IAppContext appContext, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.ICollection<IExport<IAppLifecycleBehavior, AppServiceMetadata>> | behaviors | The behaviors. |
IAppContext | appContext | Context for the application. |
System.Threading.CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A Task. |
AfterAppInitializeAsync(ICollection<IExport<IAppLifecycleBehavior, AppServiceMetadata>>, IAppContext, CancellationToken)
Overridable method called after the application was initialized.
Declaration
protected virtual Task AfterAppInitializeAsync(ICollection<IExport<IAppLifecycleBehavior, AppServiceMetadata>> behaviors, IAppContext appContext, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.ICollection<IExport<IAppLifecycleBehavior, AppServiceMetadata>> | behaviors | The behaviors. |
IAppContext | appContext | Context for the application. |
System.Threading.CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A Task. |
AfterFeatureFinalizeAsync(ICollection<IExport<IFeatureLifecycleBehavior, FeatureLifecycleBehaviorMetadata>>, IAppContext, FeatureManagerMetadata, CancellationToken)
Executes the after finalization behaviors.
Declaration
protected virtual Task AfterFeatureFinalizeAsync(ICollection<IExport<IFeatureLifecycleBehavior, FeatureLifecycleBehaviorMetadata>> behaviors, IAppContext appContext, FeatureManagerMetadata appServiceMetadata, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.ICollection<IExport<IFeatureLifecycleBehavior, FeatureLifecycleBehaviorMetadata>> | behaviors | The behaviors. |
IAppContext | appContext | Context for the application. |
FeatureManagerMetadata | appServiceMetadata | The application service metadata. |
System.Threading.CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A Task. |
AfterFeatureInitializeAsync(ICollection<IExport<IFeatureLifecycleBehavior, FeatureLifecycleBehaviorMetadata>>, IAppContext, FeatureManagerMetadata, CancellationToken)
Executes the after initialization behaviors.
Declaration
protected virtual Task AfterFeatureInitializeAsync(ICollection<IExport<IFeatureLifecycleBehavior, FeatureLifecycleBehaviorMetadata>> behaviors, IAppContext appContext, FeatureManagerMetadata appServiceMetadata, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.ICollection<IExport<IFeatureLifecycleBehavior, FeatureLifecycleBehaviorMetadata>> | behaviors | The behaviors. |
IAppContext | appContext | Context for the application. |
FeatureManagerMetadata | appServiceMetadata | The application service metadata. |
System.Threading.CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A Task. |
BeforeAppFinalizeAsync(ICollection<IExport<IAppLifecycleBehavior, AppServiceMetadata>>, IAppContext, CancellationToken)
Overridable method called before actually finalizing the application.
Declaration
protected virtual Task BeforeAppFinalizeAsync(ICollection<IExport<IAppLifecycleBehavior, AppServiceMetadata>> behaviors, IAppContext appContext, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.ICollection<IExport<IAppLifecycleBehavior, AppServiceMetadata>> | behaviors | The behaviors. |
IAppContext | appContext | Context for the application. |
System.Threading.CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A Task. |
BeforeAppInitializeAsync(ICollection<IExport<IAppLifecycleBehavior, AppServiceMetadata>>, IAppContext, CancellationToken)
Overridable method called before actually initializing the application.
Declaration
protected virtual Task BeforeAppInitializeAsync(ICollection<IExport<IAppLifecycleBehavior, AppServiceMetadata>> behaviors, IAppContext appContext, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.ICollection<IExport<IAppLifecycleBehavior, AppServiceMetadata>> | behaviors | The behaviors. |
IAppContext | appContext | Context for the application. |
System.Threading.CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A Task. |
BeforeFeatureFinalizeAsync(ICollection<IExport<IFeatureLifecycleBehavior, FeatureLifecycleBehaviorMetadata>>, IAppContext, FeatureManagerMetadata, CancellationToken)
Executes the before finalization behaviors.
Declaration
protected virtual Task BeforeFeatureFinalizeAsync(ICollection<IExport<IFeatureLifecycleBehavior, FeatureLifecycleBehaviorMetadata>> behaviors, IAppContext appContext, FeatureManagerMetadata appServiceMetadata, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.ICollection<IExport<IFeatureLifecycleBehavior, FeatureLifecycleBehaviorMetadata>> | behaviors | The behaviors. |
IAppContext | appContext | Context for the application. |
FeatureManagerMetadata | appServiceMetadata | The application service metadata. |
System.Threading.CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A Task. |
BeforeFeatureInitializeAsync(ICollection<IExport<IFeatureLifecycleBehavior, FeatureLifecycleBehaviorMetadata>>, IAppContext, FeatureManagerMetadata, CancellationToken)
Executes the before initialization behaviors.
Declaration
protected virtual Task BeforeFeatureInitializeAsync(ICollection<IExport<IFeatureLifecycleBehavior, FeatureLifecycleBehaviorMetadata>> behaviors, IAppContext appContext, FeatureManagerMetadata appServiceMetadata, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.ICollection<IExport<IFeatureLifecycleBehavior, FeatureLifecycleBehaviorMetadata>> | behaviors | The behaviors. |
IAppContext | appContext | Context for the application. |
FeatureManagerMetadata | appServiceMetadata | The application service metadata. |
System.Threading.CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A Task. |
ComputeDefaultFeatureInfo(FeatureManagerMetadata)
Calculates the feature information based on the FeatureManagerMetadata if not explicitely provided.
Declaration
protected virtual FeatureInfo ComputeDefaultFeatureInfo(FeatureManagerMetadata featureManagerMetadata)
Parameters
Type | Name | Description |
---|---|---|
FeatureManagerMetadata | featureManagerMetadata | The feature manager metadata. |
Returns
Type | Description |
---|---|
FeatureInfo | The calculated feature information. |
FinalizeAppAsync(IAppContext, CancellationToken)
Finalizes the application asynchronously.
Declaration
public virtual Task FinalizeAppAsync(IAppContext appContext, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
IAppContext | appContext | Context for the application. |
System.Threading.CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A Task. |
FinalizeFeatureAsync(IFeatureManager, IAppContext, CancellationToken)
Finalizes the feature asynchronously.
Declaration
protected virtual Task FinalizeFeatureAsync(IFeatureManager featureManager, IAppContext appContext, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
IFeatureManager | featureManager | Manager for feature. |
IAppContext | appContext | Context for the application. |
System.Threading.CancellationToken | cancellationToken | The cancellation token (optional). |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | The asynchronous result. |
FinalizeFeaturesAsync(IAppContext, CancellationToken)
Invokes the finalization of feature managers asynchronously.
Declaration
protected virtual Task FinalizeFeaturesAsync(IAppContext appContext, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
IAppContext | appContext | Context for the application. |
System.Threading.CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A Task. |
InitializeAppAsync(IAppContext, CancellationToken)
Initializes the application asynchronously.
Declaration
public virtual Task InitializeAppAsync(IAppContext appContext, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
IAppContext | appContext | Context for the application. |
System.Threading.CancellationToken | cancellationToken | The cancellation token (optional). |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A Task. |
InitializeFeatureAsync(IFeatureManager, IAppContext, CancellationToken)
Initializes the feature asynchronously.
Declaration
protected virtual Task InitializeFeatureAsync(IFeatureManager featureManager, IAppContext appContext, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
IFeatureManager | featureManager | Manager for feature. |
IAppContext | appContext | Context for the application. |
System.Threading.CancellationToken | cancellationToken | The cancellation token (optional). |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | The asynchronous result. |
InitializeFeaturesAsync(IAppContext, CancellationToken)
Invokes the initialization of feature managers asynchronously.
Declaration
protected virtual Task InitializeFeaturesAsync(IAppContext appContext, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
IAppContext | appContext | Context for the application. |
System.Threading.CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A Task. |
RemoveFailedAppRuntimeFeature(FeatureInfo)
Removes the failed feature from the application runtime.
Declaration
protected virtual void RemoveFailedAppRuntimeFeature(FeatureInfo featureInfo)
Parameters
Type | Name | Description |
---|---|---|
FeatureInfo | featureInfo | Information describing the feature. |
SetAppRuntimeFeatures(IList<FeatureInfo>)
Sets the features in the application runtime.
Declaration
protected virtual void SetAppRuntimeFeatures(IList<FeatureInfo> features)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IList<FeatureInfo> | features | The features. |
SortEnabledFeatureManagerFactories(ICollection<IExportFactory<IFeatureManager, FeatureManagerMetadata>>)
Sorts the feature manager factories.
Declaration
protected virtual ICollection<IExportFactory<IFeatureManager, FeatureManagerMetadata>> SortEnabledFeatureManagerFactories(ICollection<IExportFactory<IFeatureManager, FeatureManagerMetadata>> featureManagerFactories)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.ICollection<IExportFactory<IFeatureManager, FeatureManagerMetadata>> | featureManagerFactories | The feature manager factories. |
Returns
Type | Description |
---|---|
System.Collections.Generic.ICollection<IExportFactory<IFeatureManager, FeatureManagerMetadata>> | The sorted feature manager factories. |