C# 클래스 Castle.MicroKernel.Handlers.AbstractHandler

상속: System.MarshalByRefObject, IHandler, IExposeDependencyInfo, IDisposable
파일 보기 프로젝트 열기: nats/castle-1.0.3-mono

보호된 프로퍼티들

프로퍼티 타입 설명
lifestyleManager ILifestyleManager

공개 메소드들

메소드 설명
AbstractHandler ( ComponentModel model ) : System

Constructs and initializes the handler

AddCustomDependencyValue ( string key, object value ) : void

TODO: Pendent

CanResolve ( CreationContext context, ISubDependencyResolver parentResolver, ComponentModel model, DependencyModel dependency ) : bool
Dispose ( ) : void
HasCustomParameter ( string key ) : bool

TODO: Pendent

Init ( IKernel kernel ) : void

Saves the kernel instance, subscribes to IKernelEvents.AddedAsChildKernel event, creates the lifestyle manager instance and computes the handler state.

ObtainDependencyDetails ( IList dependenciesChecked ) : String

Returns human readable list of dependencies this handler is waiting for.

Release ( object instance ) : void

Should be implemented by derived classes: disposes the component instance (or recycle it)

RemoveCustomDependencyValue ( string key ) : void

TODO: Pendent

Resolve ( CreationContext context ) : object

Should be implemented by derived classes: returns an instance of the component this handler is responsible for

Resolve ( CreationContext context, ISubDependencyResolver parentResolver, ComponentModel model, DependencyModel dependency ) : object

보호된 메소드들

메소드 설명
AddDependency ( DependencyModel dependency ) : void

Invoked by EnsureDependenciesCanBeSatisfied in order to check if a dependency can be satisfied. If not, the handler is set to a 'waiting dependency' state.

This method registers the dependencies within the correct collection or dictionary and changes the handler state to HandlerState.WaitingDependency

CreateLifestyleManager ( IComponentActivator activator ) : ILifestyleManager

Creates an implementation of ILifestyleManager based on LifestyleType and invokes ILifestyleManager.Init to initialize the newly created manager.

DependencySatisfied ( IHandler handler, bool &stateChanged ) : void

Invoked by the kernel when one of registered dependencies were satisfied by new components registered.

Handler for the event IKernelEvents.HandlerRegistered

EnsureDependenciesCanBeSatisfied ( ) : void

Checks if the handler is able to, at very least, satisfy the dependencies for the constructor with less parameters

For each non*optional dependency, the implementation will invoke AddDependency

OnAddedAsChildKernel ( object sender, EventArgs e ) : void

Invoked when the container receives a parent container reference.

This method implementation checks whether the parent container is able to supply the dependencies for this handler.

SetNewState ( HandlerState newState ) : void

비공개 메소드들

메소드 설명
AddGraphDependency ( ComponentModel model ) : void
DisconnectEvents ( ) : void
HandlerStateChanged ( object source, EventArgs args ) : void

Handler for the event OnHandlerStateChanged

HasValidComponent ( String key ) : bool
HasValidComponent ( Type service ) : bool
IsValidHandlerState ( IHandler handler ) : bool
RaiseHandlerStateChanged ( ) : void
Union ( ICollection firstset, ICollection secondset ) : Castle.Core.DependencyModel[]

메소드 상세

AbstractHandler() 공개 메소드

Constructs and initializes the handler
public AbstractHandler ( ComponentModel model ) : System
model Castle.Core.ComponentModel
리턴 System

AddCustomDependencyValue() 공개 메소드

TODO: Pendent
public AddCustomDependencyValue ( string key, object value ) : void
key string
value object
리턴 void

AddDependency() 보호된 메소드

Invoked by EnsureDependenciesCanBeSatisfied in order to check if a dependency can be satisfied. If not, the handler is set to a 'waiting dependency' state.
This method registers the dependencies within the correct collection or dictionary and changes the handler state to HandlerState.WaitingDependency
protected AddDependency ( DependencyModel dependency ) : void
dependency Castle.Core.DependencyModel
리턴 void

CanResolve() 공개 메소드

public CanResolve ( CreationContext context, ISubDependencyResolver parentResolver, ComponentModel model, DependencyModel dependency ) : bool
context CreationContext
parentResolver ISubDependencyResolver
model Castle.Core.ComponentModel
dependency Castle.Core.DependencyModel
리턴 bool

CreateLifestyleManager() 보호된 메소드

Creates an implementation of ILifestyleManager based on LifestyleType and invokes ILifestyleManager.Init to initialize the newly created manager.
protected CreateLifestyleManager ( IComponentActivator activator ) : ILifestyleManager
activator IComponentActivator
리턴 ILifestyleManager

DependencySatisfied() 보호된 메소드

Invoked by the kernel when one of registered dependencies were satisfied by new components registered.
Handler for the event IKernelEvents.HandlerRegistered
protected DependencySatisfied ( IHandler handler, bool &stateChanged ) : void
handler IHandler
stateChanged bool
리턴 void

Dispose() 공개 메소드

public Dispose ( ) : void
리턴 void

EnsureDependenciesCanBeSatisfied() 보호된 메소드

Checks if the handler is able to, at very least, satisfy the dependencies for the constructor with less parameters
For each non*optional dependency, the implementation will invoke AddDependency
protected EnsureDependenciesCanBeSatisfied ( ) : void
리턴 void

HasCustomParameter() 공개 메소드

TODO: Pendent
public HasCustomParameter ( string key ) : bool
key string
리턴 bool

Init() 공개 메소드

Saves the kernel instance, subscribes to IKernelEvents.AddedAsChildKernel event, creates the lifestyle manager instance and computes the handler state.
public Init ( IKernel kernel ) : void
kernel IKernel
리턴 void

ObtainDependencyDetails() 공개 메소드

Returns human readable list of dependencies this handler is waiting for.
public ObtainDependencyDetails ( IList dependenciesChecked ) : String
dependenciesChecked IList
리턴 String

OnAddedAsChildKernel() 보호된 메소드

Invoked when the container receives a parent container reference.
This method implementation checks whether the parent container is able to supply the dependencies for this handler.
protected OnAddedAsChildKernel ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
리턴 void

Release() 공개 추상적인 메소드

Should be implemented by derived classes: disposes the component instance (or recycle it)
public abstract Release ( object instance ) : void
instance object
리턴 void

RemoveCustomDependencyValue() 공개 메소드

TODO: Pendent
public RemoveCustomDependencyValue ( string key ) : void
key string
리턴 void

Resolve() 공개 추상적인 메소드

Should be implemented by derived classes: returns an instance of the component this handler is responsible for
public abstract Resolve ( CreationContext context ) : object
context CreationContext
리턴 object

Resolve() 공개 메소드

public Resolve ( CreationContext context, ISubDependencyResolver parentResolver, ComponentModel model, DependencyModel dependency ) : object
context CreationContext
parentResolver ISubDependencyResolver
model Castle.Core.ComponentModel
dependency Castle.Core.DependencyModel
리턴 object

SetNewState() 보호된 메소드

protected SetNewState ( HandlerState newState ) : void
newState HandlerState
리턴 void

프로퍼티 상세

lifestyleManager 보호되어 있는 프로퍼티

Lifestyle manager instance
protected ILifestyleManager lifestyleManager
리턴 ILifestyleManager