Class ModuleBase
Provides base for IModuleImplementation. The descendants of this class are always injected
via configuration injection process and never by code because modules are not practically
expected to be created dynamically at runtime - they always get created by application chassis at boot.
Inheritance
System.Object
ModuleBase
Implements
System.IDisposable
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Assembly: Azos.dll
Syntax
public abstract class ModuleBase : ApplicationComponent, IModuleImplementation, IModule, IApplicationComponent, INamed, IOrdered, IDisposable, IConfigurable, IInstrumentable, IExternallyParameterized, IApplicationInjection
Constructors
ModuleBase(IModule)
Creates a module under a parent module, such as HubModule
Declaration
protected ModuleBase(IModule parent)
Parameters
Type |
Name |
Description |
IModule |
parent |
|
ModuleBase(IApplication)
Creates a root module without a parent
Declaration
protected ModuleBase(IApplication application)
Parameters
Fields
m_Children
Declaration
protected OrderedRegistry<ModuleBase> m_Children
Field Value
Properties
ChildModules
Declaration
public IOrderedRegistry<IModule> ChildModules { get; }
Property Value
ComponentCommonName
Declaration
public override string ComponentCommonName { get; }
Property Value
Type |
Description |
System.String |
|
Overrides
InstrumentationEnabled
Declaration
public virtual bool InstrumentationEnabled { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
IsHardcodedModule
Declaration
public abstract bool IsHardcodedModule { get; }
Property Value
Type |
Description |
System.Boolean |
|
Name
Declaration
public virtual string Name { get; }
Property Value
Type |
Description |
System.String |
|
Order
Declaration
public int Order { get; }
Property Value
Type |
Description |
System.Int32 |
|
ParentModule
Declaration
public IModule ParentModule { get; }
Property Value
Methods
Destructor()
Declaration
protected override void Destructor()
Overrides
DoApplicationAfterInit()
Override to perform this module-specific actions after app container init.
The DI has already taken place.
Return true only when the system should not continue to call all child modules, false to let the system call all child modules.
The call is used to perform initialization tasks such as inter-service dependency fixups by code,
initial data loads (e.g. initial cache fetch etc..) after everything has loaded in the application container.
The implementation is expected to handle internal exceptions gracefully (i.e. use log etc.)
Declaration
protected virtual bool DoApplicationAfterInit()
Returns
Type |
Description |
System.Boolean |
|
DoApplicationBeforeCleanup()
Override to perform this module-specific actions before app container shutdown.
Return true only when the system should not continue to call all child modules, false let the system call all child modules.
The call is used to perform finalization tasks such as inter-service dependency tears and flushes before
everything is about to be shutdown in the application container.
The implementation is expected to handle internal exceptions gracefully (i.e. use log etc.)
Declaration
protected virtual bool DoApplicationBeforeCleanup()
Returns
Type |
Description |
System.Boolean |
|
Override to configure the instance
Declaration
protected virtual void DoConfigure(IConfigSectionNode node)
Parameters
Override to perform custom population/registration of modules
Declaration
protected virtual void DoConfigureChildModules(IConfigSectionNode node)
Parameters
DoExternalGetParameter(String, out Object, String[])
Declaration
protected virtual bool DoExternalGetParameter(string name, out object value, params string[] groups)
Parameters
Type |
Name |
Description |
System.String |
name |
|
System.Object |
value |
|
System.String[] |
groups |
|
Returns
Type |
Description |
System.Boolean |
|
DoExternalSetParameter(String, Object, String[])
Declaration
protected virtual bool DoExternalSetParameter(string name, object value, params string[] groups)
Parameters
Type |
Name |
Description |
System.String |
name |
|
System.Object |
value |
|
System.String[] |
groups |
|
Returns
Type |
Description |
System.Boolean |
|
DoGetAllChildModuleConfigNodes(IConfigSectionNode)
Declaration
protected virtual IEnumerable<IConfigSectionNode> DoGetAllChildModuleConfigNodes(IConfigSectionNode node)
Parameters
Returns
DoGetExternalParameters()
Declaration
protected virtual IEnumerable<KeyValuePair<string, Type>> DoGetExternalParameters()
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String, System.Type>> |
|
DoGetExternalParametersForGroups(String[])
Declaration
protected virtual IEnumerable<KeyValuePair<string, Type>> DoGetExternalParametersForGroups(params string[] groups)
Parameters
Type |
Name |
Description |
System.String[] |
groups |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String, System.Type>> |
|
DoInjectApplication(IApplicationDependencyInjector)
Override to perform custom DI, the default implementation injects content into all child modules.
The DI is done before DoApplicationAfterInit() call by app chassis
Declaration
protected virtual bool DoInjectApplication(IApplicationDependencyInjector injector)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Get<TModule>(Func<TModule, Boolean>)
Declaration
public virtual TModule Get<TModule>(Func<TModule, bool> filter = null)
where TModule : class, IModule
Parameters
Type |
Name |
Description |
System.Func<TModule, System.Boolean> |
filter |
|
Returns
Type Parameters
Get<TModule>(String)
Declaration
public virtual TModule Get<TModule>(string name)
where TModule : class, IModule
Parameters
Type |
Name |
Description |
System.String |
name |
|
Returns
Type Parameters
ToString()
Declaration
public override string ToString()
Returns
Type |
Description |
System.String |
|
Overrides
TryGet<TModule>(Func<TModule, Boolean>)
Declaration
public virtual TModule TryGet<TModule>(Func<TModule, bool> filter)
where TModule : class, IModule
Parameters
Type |
Name |
Description |
System.Func<TModule, System.Boolean> |
filter |
|
Returns
Type Parameters
TryGet<TModule>(String)
Declaration
public virtual TModule TryGet<TModule>(string name)
where TModule : class, IModule
Parameters
Type |
Name |
Description |
System.String |
name |
|
Returns
Type Parameters
Explicit Interface Implementations
IModuleImplementation.ApplicationAfterInit()
Declaration
void IModuleImplementation.ApplicationAfterInit()
IModuleImplementation.ApplicationBeforeCleanup()
Declaration
void IModuleImplementation.ApplicationBeforeCleanup()
IApplicationInjection.InjectApplication(IApplicationDependencyInjector)
Declaration
bool IApplicationInjection.InjectApplication(IApplicationDependencyInjector injector)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Declaration
void IConfigurable.Configure(IConfigSectionNode node)
Parameters
IExternallyParameterized.ExternalGetParameter(String, out Object, String[])
Declaration
bool IExternallyParameterized.ExternalGetParameter(string name, out object value, params string[] groups)
Parameters
Type |
Name |
Description |
System.String |
name |
|
System.Object |
value |
|
System.String[] |
groups |
|
Returns
Type |
Description |
System.Boolean |
|
IExternallyParameterized.ExternalParameters
Declaration
IEnumerable<KeyValuePair<string, Type>> IExternallyParameterized.ExternalParameters { get; }
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String, System.Type>> |
|
IExternallyParameterized.ExternalParametersForGroups(String[])
Declaration
IEnumerable<KeyValuePair<string, Type>> IExternallyParameterized.ExternalParametersForGroups(params string[] groups)
Parameters
Type |
Name |
Description |
System.String[] |
groups |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String, System.Type>> |
|
IExternallyParameterized.ExternalSetParameter(String, Object, String[])
Declaration
bool IExternallyParameterized.ExternalSetParameter(string name, object value, params string[] groups)
Parameters
Type |
Name |
Description |
System.String |
name |
|
System.Object |
value |
|
System.String[] |
groups |
|
Returns
Type |
Description |
System.Boolean |
|
Implements
System.IDisposable
Extension Methods