C# 클래스 Castle.MicroKernel.Resolvers.DefaultDependencyResolver

상속: IDependencyResolver
파일 보기 프로젝트 열기: 7digital/Castle.Windsor

공개 메소드들

메소드 설명
AddSubResolver ( ISubDependencyResolver subResolver ) : void

Registers a sub resolver instance

CanResolve ( CreationContext context, ISubDependencyResolver contextHandlerResolver, ComponentModel model, DependencyModel dependency ) : bool

Returns true if the resolver is able to satisfy the specified dependency.

Initialize ( IKernel kernel, DependencyDelegate dependencyDelegate ) : void

Initializes this instance with the specified dependency delegate.

RemoveSubResolver ( ISubDependencyResolver subResolver ) : void

Unregisters a sub resolver instance previously registered

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

Try to resolve the dependency by checking the parameters in the model or checking the Kernel for the requested service.

The dependency resolver has the following precedence order: The dependency is checked within the CreationContext The dependency is checked within the IHandler instance for the component The dependency is checked within the registered ISubDependencyResolver s Finally the resolver tries the normal flow which is using the configuration or other component to satisfy the dependency

보호된 메소드들

메소드 설명
CanResolveParameterDependency ( ComponentModel model, DependencyModel dependency ) : bool
CanResolveServiceDependency ( CreationContext context, ComponentModel model, DependencyModel dependency ) : bool
ExtractComponentKey ( String keyValue, String name ) : String

Extracts the component name from the a ref strings which is ${something}

ObtainParameterModelMatchingDependency ( DependencyModel dependency, ComponentModel model ) : ParameterModel
RebuildContextForParameter ( CreationContext current, Type parameterType ) : CreationContext

This method rebuild the context for the parameter type. Naive implementation.

ResolveParameterDependency ( CreationContext context, ComponentModel model, DependencyModel dependency ) : object
ResolveServiceDependency ( CreationContext context, ComponentModel model, DependencyModel dependency ) : object

비공개 메소드들

메소드 설명
GetParameterModelByType ( Type type, ComponentModel model ) : ParameterModel
HasComponentInValidState ( CreationContext context, Type service ) : bool
HasComponentInValidState ( string key ) : bool
IsHandlerInValidState ( IHandler handler ) : bool
ObtainParameterModelByKey ( DependencyModel dependency, ComponentModel model ) : ParameterModel
ObtainParameterModelByType ( DependencyModel dependency, ComponentModel model ) : ParameterModel
RaiseDependencyResolving ( ComponentModel model, DependencyModel dependency, object value ) : void
TryGetHandlerFromKernel ( DependencyModel dependency, CreationContext context ) : IHandler

메소드 상세

AddSubResolver() 공개 메소드

Registers a sub resolver instance
public AddSubResolver ( ISubDependencyResolver subResolver ) : void
subResolver ISubDependencyResolver The subresolver instance
리턴 void

CanResolve() 공개 메소드

Returns true if the resolver is able to satisfy the specified dependency.
public CanResolve ( CreationContext context, ISubDependencyResolver contextHandlerResolver, ComponentModel model, DependencyModel dependency ) : bool
context Castle.MicroKernel.Context.CreationContext Creation context, which is a resolver itself
contextHandlerResolver ISubDependencyResolver Parent resolver
model Castle.Core.ComponentModel Model of the component that is requesting the dependency
dependency Castle.Core.DependencyModel The dependency model
리턴 bool

CanResolveParameterDependency() 보호된 메소드

protected CanResolveParameterDependency ( ComponentModel model, DependencyModel dependency ) : bool
model Castle.Core.ComponentModel
dependency Castle.Core.DependencyModel
리턴 bool

CanResolveServiceDependency() 보호된 메소드

protected CanResolveServiceDependency ( CreationContext context, ComponentModel model, DependencyModel dependency ) : bool
context Castle.MicroKernel.Context.CreationContext
model Castle.Core.ComponentModel
dependency Castle.Core.DependencyModel
리턴 bool

ExtractComponentKey() 보호된 메소드

Extracts the component name from the a ref strings which is ${something}
protected ExtractComponentKey ( String keyValue, String name ) : String
keyValue String
name String
리턴 String

Initialize() 공개 메소드

Initializes this instance with the specified dependency delegate.
public Initialize ( IKernel kernel, DependencyDelegate dependencyDelegate ) : void
kernel IKernel kernel
dependencyDelegate DependencyDelegate The dependency delegate.
리턴 void

ObtainParameterModelMatchingDependency() 보호된 메소드

protected ObtainParameterModelMatchingDependency ( DependencyModel dependency, ComponentModel model ) : ParameterModel
dependency Castle.Core.DependencyModel
model Castle.Core.ComponentModel
리턴 Castle.Core.ParameterModel

RebuildContextForParameter() 보호된 메소드

This method rebuild the context for the parameter type. Naive implementation.
protected RebuildContextForParameter ( CreationContext current, Type parameterType ) : CreationContext
current Castle.MicroKernel.Context.CreationContext
parameterType System.Type
리턴 Castle.MicroKernel.Context.CreationContext

RemoveSubResolver() 공개 메소드

Unregisters a sub resolver instance previously registered
public RemoveSubResolver ( ISubDependencyResolver subResolver ) : void
subResolver ISubDependencyResolver The subresolver instance
리턴 void

Resolve() 공개 메소드

Try to resolve the dependency by checking the parameters in the model or checking the Kernel for the requested service.
The dependency resolver has the following precedence order: The dependency is checked within the CreationContext The dependency is checked within the IHandler instance for the component The dependency is checked within the registered ISubDependencyResolver s Finally the resolver tries the normal flow which is using the configuration or other component to satisfy the dependency
public Resolve ( CreationContext context, ISubDependencyResolver contextHandlerResolver, ComponentModel model, DependencyModel dependency ) : object
context Castle.MicroKernel.Context.CreationContext Creation context, which is a resolver itself
contextHandlerResolver ISubDependencyResolver Parent resolver
model Castle.Core.ComponentModel Model of the component that is requesting the dependency
dependency Castle.Core.DependencyModel The dependency model
리턴 object

ResolveParameterDependency() 보호된 메소드

protected ResolveParameterDependency ( CreationContext context, ComponentModel model, DependencyModel dependency ) : object
context Castle.MicroKernel.Context.CreationContext
model Castle.Core.ComponentModel
dependency Castle.Core.DependencyModel
리턴 object

ResolveServiceDependency() 보호된 메소드

protected ResolveServiceDependency ( CreationContext context, ComponentModel model, DependencyModel dependency ) : object
context Castle.MicroKernel.Context.CreationContext
model Castle.Core.ComponentModel
dependency Castle.Core.DependencyModel
리턴 object