Show / Hide Table of Contents

Class ModuleBase

Provides base for implementation of IModule

Inheritance
System.Object
DisposableObject
ApplicationComponent
ModuleBase
HubModule
NOPModule
WidgetRenderer
Implements
IModuleImplementation
IModule
IApplicationComponent
INamed
IOrdered
System.IDisposable
IConfigurable
IInstrumentable
IExternallyParameterized
Inherited Members
ApplicationComponent.AllComponents
ApplicationComponent.GetAppComponentBySID(UInt64)
ApplicationComponent.GetAppComponentByCommonName(String)
ApplicationComponent.ComponentSID
ApplicationComponent.ComponentStartTime
ApplicationComponent.ComponentCommonName
ApplicationComponent.ComponentDirector
DisposableObject.DisposeAndNull<T>(T)
DisposableObject.DisposeStarted
DisposableObject.Disposed
DisposableObject.EnsureObjectNotDisposed()
DisposableObject.Dispose()
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)
Namespace: NFX.ApplicationModel
Assembly: NFX.dll
Syntax
public abstract class ModuleBase : ApplicationComponent, IModuleImplementation, IModule, IApplicationComponent, INamed, IOrdered, IDisposable, IConfigurable, IInstrumentable, IExternallyParameterized

Constructors

ModuleBase()

Creates a root module without a parent

Declaration
protected ModuleBase()

ModuleBase(IModule)

Creates a module under a parent module, such as HubModule

Declaration
protected ModuleBase(IModule parent)
Parameters
Type Name Description
IModule parent

ModuleBase(IModule, Int32)

Creates a module under a parent module with the specified order, such as HubModule

Declaration
protected ModuleBase(IModule parent, int order)
Parameters
Type Name Description
IModule parent
System.Int32 order

Fields

m_Children

Declaration
protected OrderedRegistry<ModuleBase> m_Children
Field Value
Type Description
OrderedRegistry<ModuleBase>

Properties

ChildModules

Declaration
public IOrderedRegistry<IModule> ChildModules { get; }
Property Value
Type Description
IOrderedRegistry<IModule>

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

ModuleEffectiveLogLevel

Declaration
public virtual MessageType ModuleEffectiveLogLevel { get; }
Property Value
Type Description
MessageType

ModuleLogLevel

Declaration
public MessageType? ModuleLogLevel { get; set; }
Property Value
Type Description
System.Nullable<MessageType>

Name

Declaration
public 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
Type Description
IModule

Methods

Destructor()

Declaration
protected override void Destructor()
Overrides
ApplicationComponent.Destructor()

DoApplicationAfterInit(IApplication)

Override to perform this module-specific actions after app container init. 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, 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(IApplication application)
Parameters
Type Name Description
IApplication application
Returns
Type Description
System.Boolean

DoApplicationBeforeCleanup(IApplication)

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(IApplication application)
Parameters
Type Name Description
IApplication application
Returns
Type Description
System.Boolean

DoConfigure(IConfigSectionNode)

Override to configure the instance

Declaration
protected virtual void DoConfigure(IConfigSectionNode node)
Parameters
Type Name Description
IConfigSectionNode node

DoConfigureChildModules(IConfigSectionNode)

Override to perform custom population/registration of modules

Declaration
protected virtual void DoConfigureChildModules(IConfigSectionNode node)
Parameters
Type Name Description
IConfigSectionNode node

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
Type Name Description
IConfigSectionNode node
Returns
Type Description
System.Collections.Generic.IEnumerable<IConfigSectionNode>

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>>

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 Description
TModule
Type Parameters
Name Description
TModule

Get<TModule>(String)

Declaration
public virtual TModule Get<TModule>(string name)where TModule : class, IModule
Parameters
Type Name Description
System.String name
Returns
Type Description
TModule
Type Parameters
Name Description
TModule

ModuleLog(MessageType, String, String, Exception, Nullable<Guid>, String)

Declaration
public virtual Guid ModuleLog(MessageType type, string from, string text, Exception error = null, Guid? related = default (Guid? ), string pars = null)
Parameters
Type Name Description
MessageType type
System.String from
System.String text
System.Exception error
System.Nullable<System.Guid> related
System.String pars
Returns
Type Description
System.Guid

ToString()

Declaration
public override string ToString()
Returns
Type Description
System.String
Overrides
System.Object.ToString()

TryGet<TModule>(Func<TModule, Boolean>)

Declaration
public TModule TryGet<TModule>(Func<TModule, bool> filter)where TModule : class, IModule
Parameters
Type Name Description
System.Func<TModule, System.Boolean> filter
Returns
Type Description
TModule
Type Parameters
Name Description
TModule

TryGet<TModule>(String)

Declaration
public virtual TModule TryGet<TModule>(string name)where TModule : class, IModule
Parameters
Type Name Description
System.String name
Returns
Type Description
TModule
Type Parameters
Name Description
TModule

Explicit Interface Implementations

IModuleImplementation.ApplicationAfterInit(IApplication)

Declaration
void IModuleImplementation.ApplicationAfterInit(IApplication application)
Parameters
Type Name Description
IApplication application

IModuleImplementation.ApplicationBeforeCleanup(IApplication)

Declaration
void IModuleImplementation.ApplicationBeforeCleanup(IApplication application)
Parameters
Type Name Description
IApplication application

IConfigurable.Configure(IConfigSectionNode)

Declaration
void IConfigurable.Configure(IConfigSectionNode node)
Parameters
Type Name Description
IConfigSectionNode node

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

IModuleImplementation
IModule
IApplicationComponent
INamed
IOrdered
System.IDisposable
IConfigurable
IInstrumentable
IExternallyParameterized

Extension Methods

MiscUtils.NonNull<T>(T, Func<Exception>, String)
ObjectValueConversion.AsString(Object, String, ConvertErrorHandling)
ObjectValueConversion.AsNonNullOrEmptyString(Object)
ObjectValueConversion.AsLaconicConfig(Object, ConfigSectionNode, String, ConvertErrorHandling)
ObjectValueConversion.AsJSONConfig(Object, ConfigSectionNode, String, ConvertErrorHandling)
ObjectValueConversion.AsXMLConfig(Object, ConfigSectionNode, ConvertErrorHandling)
ObjectValueConversion.AsChar(Object, Char, ConvertErrorHandling)
ObjectValueConversion.AsNullableChar(Object, Nullable<Char>, ConvertErrorHandling)
ObjectValueConversion.AsByte(Object, Byte, ConvertErrorHandling)
ObjectValueConversion.AsNullableByte(Object, Nullable<Byte>, ConvertErrorHandling)
ObjectValueConversion.AsSByte(Object, SByte, ConvertErrorHandling)
ObjectValueConversion.AsNullableSByte(Object, Nullable<SByte>, ConvertErrorHandling)
ObjectValueConversion.AsShort(Object, Int16, ConvertErrorHandling)
ObjectValueConversion.AsNullableShort(Object, Nullable<Int16>, ConvertErrorHandling)
ObjectValueConversion.AsUShort(Object, UInt16, ConvertErrorHandling)
ObjectValueConversion.AsNullableUShort(Object, Nullable<UInt16>, ConvertErrorHandling)
ObjectValueConversion.AsInt(Object, Int32, ConvertErrorHandling)
ObjectValueConversion.AsNullableInt(Object, Nullable<Int32>, ConvertErrorHandling)
ObjectValueConversion.AsUInt(Object, UInt32, ConvertErrorHandling)
ObjectValueConversion.AsNullableUInt(Object, Nullable<UInt32>, ConvertErrorHandling)
ObjectValueConversion.AsLong(Object, Int64, ConvertErrorHandling)
ObjectValueConversion.AsNullableLong(Object, Nullable<Int64>, ConvertErrorHandling)
ObjectValueConversion.AsULong(Object, UInt64, ConvertErrorHandling)
ObjectValueConversion.AsNullableULong(Object, Nullable<UInt64>, ConvertErrorHandling)
ObjectValueConversion.AsDouble(Object, Double, ConvertErrorHandling)
ObjectValueConversion.AsNullableDouble(Object, Nullable<Double>, ConvertErrorHandling)
ObjectValueConversion.AsFloat(Object, Single, ConvertErrorHandling)
ObjectValueConversion.AsNullableFloat(Object, Nullable<Single>, ConvertErrorHandling)
ObjectValueConversion.AsDecimal(Object, Decimal, ConvertErrorHandling)
ObjectValueConversion.AsNullableDecimal(Object, Nullable<Decimal>, ConvertErrorHandling)
ObjectValueConversion.AsBool(Object, Boolean, ConvertErrorHandling)
ObjectValueConversion.AsNullableBool(Object, Nullable<Boolean>, ConvertErrorHandling)
ObjectValueConversion.AsGUID(Object, Guid, ConvertErrorHandling)
ObjectValueConversion.AsNullableGUID(Object, Nullable<Guid>, ConvertErrorHandling)
ObjectValueConversion.AsDateTime(Object)
ObjectValueConversion.AsDateTime(Object, DateTime, ConvertErrorHandling)
ObjectValueConversion.AsNullableDateTime(Object, Nullable<DateTime>, ConvertErrorHandling)
ObjectValueConversion.AsGDID(Object)
ObjectValueConversion.AsGDID(Object, GDID, ConvertErrorHandling)
ObjectValueConversion.AsNullableGDID(Object, Nullable<GDID>, ConvertErrorHandling)
ObjectValueConversion.AsGDIDSymbol(Object)
ObjectValueConversion.AsGDIDSymbol(Object, GDIDSymbol, ConvertErrorHandling)
ObjectValueConversion.AsNullableGDIDSymbol(Object, Nullable<GDIDSymbol>, ConvertErrorHandling)
ObjectValueConversion.AsTimeSpan(Object)
ObjectValueConversion.AsTimeSpan(Object, TimeSpan, ConvertErrorHandling)
ObjectValueConversion.AsNullableTimeSpan(Object, Nullable<TimeSpan>, ConvertErrorHandling)
ObjectValueConversion.AsEnum<TEnum>(Object, TEnum, ConvertErrorHandling)
ObjectValueConversion.AsNullableEnum<TEnum>(Object, Nullable<TEnum>, ConvertErrorHandling)
ObjectValueConversion.AsUri(Object, Uri, ConvertErrorHandling)
JSONExtensions.ToJSON(Object, JSONWritingOptions)
JSONExtensions.ToJSON(Object, TextWriter, JSONWritingOptions)
JSONExtensions.ToJSON(Object, Stream, JSONWritingOptions, Encoding)
ErlObject.ToErlObject(Object)
ErlObject.ToErlObject(Object, ErlTypeOrder, Boolean)
Back to top Copyright © 2006-2018 Agnicore Inc
Generated by DocFX