[DiscoverableAttribute] public class ApplicationManager : Manager, IApplicationManager, IManager, IStateful, IEventProvider, IProvider
<DiscoverableAttribute> Public Class ApplicationManager Inherits Manager Implements IApplicationManager, IManager, IStateful, IEventProvider, IProvider
[DiscoverableAttribute] public ref class ApplicationManager : public Manager, IApplicationManager, IManager, IStateful, IEventProvider, IProvider
[<DiscoverableAttribute>] type ApplicationManager = class inherit Manager interface IApplicationManager interface IManager interface IStateful interface IEventProvider interface IProvider end
Thetype exposes the following members.
Initializes a new instance of theclass with the specified Manager Types.
Gets a value indicating whether the stateful object is pending an automatic restart.(Inherited from Manager.)
Gets the dictionary of IManagers upon which this Manager depends, keyed on Type name.(Inherited from Manager.)
Gets or sets the Event Provider name.(Inherited from Manager.)
Gets the name of the application instance, retrieved from the application's settings file.
Gets or sets a dictionary containing a list of dependencies for each application Manager.
Gets or sets the list of application Manager instances.
Gets or sets the name of the Manager.(Inherited from Manager.)
Gets or sets the list of application Manager Types.
Gets the name of the product, retrieved from AssemblyInfo.cs.
Gets the version of the product, retrieved from AssemblyInfo.cs.
Gets the current State of the Stateful object.(Inherited from Manager.)
|ChangeState(State, String, StopType)||Manager.)|
Examines the State of the IManager s contained within the Dependencies property to ensure each is in a State contained within the supplied list of State s. If not, an error message is added to the return .(Inherited from Manager.)
Occurs when the state of a Manager upon which this Manager is dependent changes.(Inherited from Manager.)
Disposes this Manager.(Inherited from Manager.)
Disposes the restartTimer property.(Inherited from Manager.)
Returns the Singleton instance of ApplicationManager
Returns the "InstanceName" setting from the app.config file, or the default value if the setting is not retrieved.
Returns the Manager from the list of Managers matching the specified Type.
Returns the singleton instance of the ApplicationManager. Creates an instance if null.
Creates and returns an instance of the specified IManager Type.
Iterates over the list of IManager Types and instantiates each in the order in which they are represented in the list.
|InvokeMethod(MethodInfo, Type, Type, String, Object)|
|InvokeMethodT(MethodInfo, Type, Type, String, Object)|
Searches the list of registered IManager instances for the specified instance and returns a value indicating whether it was found.
Event handler for the StateChanged event of registered Managers.
Returns a list of IManager instances corresponding to the Manager Types upon which the specified Manager is dependent.
Restarts the Manager.(Inherited from Manager.)
Occurs when the restart timer's interval elapses.(Inherited from Manager.)
Implements the Manager-specific post-instantiation procedure.(Inherited from Manager.)
Executed upon shutdown of the Manager. Stops all application managers.(Overrides ManagerShutdown(StopType).)
Starts the Manager.(Inherited from Manager.)
Starts the specified IManager instance
Starts each IManager contained within the specified list of Manager instances.
Executed upon startup of the Manager. Starts all application managers.(Overrides ManagerStartup.)
Stops the Manager.(Inherited from Manager.)
Stops the specified IManager instance.
Stops each of the IManager instances in the specified Manager instance list.
Implements the Manager-specific disposal procedure.(Inherited from Manager.)
Terminates Singleton instance of ApplicationManager.
The dictionary of IManagers upon which this Manager depends, keyed on Type name.(Inherited from Manager.)
The Singleton instance of ApplicationManager.
The Logger for this class.
The restart timer, used to automatically restart the Manager following a Stop with pending restart.(Inherited from Manager.)
This class is a Singleton and is therefore restricted to one instance for the application. External classes may invoke the Instantiate(Type) method to retrieve the instance, however they should not. If the instance is required in a static class or method, or anywhere else where dependency injection is not available, the GetInstance method should be used to retrieve the instance.
The Instantiate(Type) method, and thusly the class constructor, accepts an array of Type s corresponding to each IManager instance to be created. The Application Manager maintains an internal list of these Types, the instances of the Types created (one each), and a dictionary containing the dependencies of each Type.
Upon instantiation, the Application Manager invokes InstantiateManagers method which iterates over the list of Types and creates an instance of each using the InstantiateManagerT method, then registers the new instance with RegisterManagerT(IManager). If all dependencies for a Manager have not yet been instantiated when the dependent Manager is instantiated an exception will be thrown; the order in which the Manager Types appear in the Type list provided to the Instantiate(Type) method must reflect the inter-Manager dependencies. The RegisterManager method adds the Manager instance to the internal list and creates an entry in the dependency dictionary for the Type.
After all Managers have been instantiated, the list of created instances is iterated over and the Setup method is invoked on each. This method allows Managers which are dependent upon other Managers to initialize those dependencies. Examples include the ConfigurationManager, which iterates over the list of Manager instances and registers Managers which implement IConfigurableT, and the EventManager, which does the same for implementations of IEventProvider.
The method GetManagerT and property Managers are provided to allow Managers to retrieve other Managers contained within the application. GetManagerT is primarily provided to allow static methods to access a particular manager. This is the only valid usage; instance methods should use the dependency injection system. The Managers property provides an immutable list of Manager instances which allows for the functionality described above for Setup. This is necessary so that Managers may access other Managers which are not explicitly defined as dependencies. Again, this is the only valid usage of the method.
As with other instances of IManager, the Startup and Shutdown(StopType) methods are invoked upon the invocation of Start and Stop(StopType). The Application Manager uses these methods to start and stop Manager instances.