C# Class Castle.Facilities.Startable.StartableFacility

Inheritance: Castle.MicroKernel.Facilities.AbstractFacility
Show file Open project: 7digital/Castle.Windsor Class Usage Examples

Public Methods

Method Description
DeferredStart ( ) : void

This method changes behavior of the facility. Deferred mode should be used when you have single call to IWindsorContainer.Install and register all your components there. Enabling this mode will optimize the behavior of the facility so that it will wait 'till the end of installation and only after all IWindsorInstallers were ran it will instantiate and start all the startable components. An exception will be thrown if a startable component can't be instantiated and started. This will help you fail fast and diagnose issues quickly. If you don't want the exception to be thrown and you prefer the component to fail silently, use DeferredTryStart method instead.

It is recommended to use this method over DeferredTryStart method.

DeferredTryStart ( ) : void

This method changes behavior of the facility. Deferred mode should be used when you have single call to IWindsorContainer.Install and register all your components there. Enabling this mode will optimize the behavior of the facility so that it will wait 'till the end of installation and only after all IWindsorInstallers were ran it will instantiate and start all the startable components. No exception will be thrown if a startable component can't be instantiated and started. If you'd rather fail fast and diagnose issues quickly, use DeferredStart method instead.

It is recommended to use DeferredStart method over this method.

Protected Methods

Method Description
Init ( ) : void

Private Methods

Method Description
AddHandlerToWaitingList ( IHandler handler ) : void
CacheForStart ( string key, IHandler handler ) : void
CheckWaitingList ( ) : void

For each new component registered, some components in the WaitingDependency state may have became valid, so we check them

IsStartable ( IHandler handler ) : bool
OnComponentRegistered ( String key, IHandler handler ) : void
OnHandlerStateChanged ( object source, EventArgs args ) : void
Start ( IHandler handler ) : void
StartAll ( bool &statechanged ) : void
StartAllInternal ( object sender, EventArgs e ) : void
TryStart ( IHandler handler ) : bool

Request the component instance

Method Details

DeferredStart() public method

This method changes behavior of the facility. Deferred mode should be used when you have single call to IWindsorContainer.Install and register all your components there. Enabling this mode will optimize the behavior of the facility so that it will wait 'till the end of installation and only after all IWindsorInstallers were ran it will instantiate and start all the startable components. An exception will be thrown if a startable component can't be instantiated and started. This will help you fail fast and diagnose issues quickly. If you don't want the exception to be thrown and you prefer the component to fail silently, use DeferredTryStart method instead.
It is recommended to use this method over DeferredTryStart method.
public DeferredStart ( ) : void
return void

DeferredTryStart() public method

This method changes behavior of the facility. Deferred mode should be used when you have single call to IWindsorContainer.Install and register all your components there. Enabling this mode will optimize the behavior of the facility so that it will wait 'till the end of installation and only after all IWindsorInstallers were ran it will instantiate and start all the startable components. No exception will be thrown if a startable component can't be instantiated and started. If you'd rather fail fast and diagnose issues quickly, use DeferredStart method instead.
It is recommended to use DeferredStart method over this method.
public DeferredTryStart ( ) : void
return void

Init() protected method

protected Init ( ) : void
return void