<PackageReference Include="Castle.Windsor" Version="6.0.0" />

DefaultKernel

Default implementation of IKernel. This implementation is complete and also support a kernel hierarchy (sub containers).

public virtual IConfigurationStore ConfigurationStore { get; set; }

public GraphNode[] GraphNodes { get; }

Graph of components and interactions.

public ILogger Logger { get; set; }

protected INamingSubSystem NamingSubSystem { get; }

public virtual IKernel Parent { get; set; }

public IProxyFactory ProxyFactory { get; set; }

public IReleasePolicy ReleasePolicy { get; set; }

public IDependencyResolver Resolver { get; }

public DefaultKernel()

Constructs a DefaultKernel with no component proxy support.

public DefaultKernel(IDependencyResolver resolver, IProxyFactory proxyFactory)

Constructs a DefaultKernel with the specified implementation of IProxyFactory and IDependencyResolver

public DefaultKernel(IProxyFactory proxyFactory)

Constructs a DefaultKernel with the specified implementation of IProxyFactory

public virtual void AddChildKernel(IKernel childKernel)

public virtual IKernel AddFacility(IFacility facility)

public IKernel AddFacility<T>() where T : IFacility

public IKernel AddFacility<T>(Action<T> onCreate) where T : IFacility

public void AddHandlerSelector(IHandlerSelector selector)

public void AddHandlersFilter(IHandlersFilter filter)

public virtual void AddSubSystem(string name, ISubSystem subsystem)

protected CreationContext CreateCreationContext(IHandler handler, Type requestedType, Arguments additionalArguments, CreationContext parent, IReleasePolicy policy)

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

public virtual void Dispose()

Starts the process of component disposal.

protected void DisposeHandler(IHandler handler)

public virtual IHandler[] GetAssignableHandlers(Type service)

Return handlers for components that implements the specified service. The check is made using IsAssignableFrom

public virtual IFacility[] GetFacilities()

Returns the facilities registered on the kernel.

public virtual IHandler GetHandler(string name)

public virtual IHandler GetHandler(Type service)

public virtual IHandler[] GetHandlers(Type service)

Return handlers for components that implements the specified service.

public virtual IHandler[] GetHandlers()

Returns all handlers for all components

public virtual ISubSystem GetSubSystem(string name)

public virtual bool HasComponent(string name)

public virtual bool HasComponent(Type serviceType)

protected virtual void RaiseAddedAsChildKernel()

protected virtual void RaiseComponentCreated(ComponentModel model, object instance)

protected virtual void RaiseComponentDestroyed(ComponentModel model, object instance)

protected virtual void RaiseComponentModelCreated(ComponentModel model)

protected virtual void RaiseComponentRegistered(string key, IHandler handler)

protected virtual void RaiseDependencyResolving(ComponentModel client, DependencyModel model, object dependency)

protected virtual void RaiseHandlerRegistered(IHandler handler)

protected virtual void RaiseHandlersChanged()

protected virtual void RaiseRegistrationCompleted()

protected virtual void RaiseRemovedAsChildKernel()

public IKernel Register(IRegistration[] registrations)

Registers the components with the IKernel. The instances of IRegistration are produced by fluent registration API. Most common entry points are For<T> method to register a single type or (recommended in most cases) FromAssembly. Let the Intellisense drive you through the fluent API past those entry points.

protected virtual void RegisterSubSystems()

public virtual void ReleaseComponent(object instance)

Releases a component instance. This allows the kernel to execute the proper decommission lifecycles on the component instance.

public virtual void RemoveChildKernel(IKernel childKernel)

public virtual object Resolve(string key, Type service)

Returns a component instance by the key

public virtual object Resolve(string key, Type service, Arguments arguments)

Returns a component instance by the key

public T Resolve<T>(Arguments arguments)

Returns the component instance by the service type using dynamic arguments

public T Resolve<T>()

Returns the component instance by the component key

public T Resolve<T>(string key)

Returns a component instance by the key

public T Resolve<T>(string key, Arguments arguments)

Returns a component instance by the key

public object Resolve(Type service)

Returns the component instance by the service type

public object Resolve(Type service, Arguments arguments)

Returns the component instance by the service type using dynamic arguments

public Array ResolveAll(Type service)

Returns all the valid component instances by the service type

public Array ResolveAll(Type service, Arguments arguments)

Returns all the valid component instances by the service type

public TService[] ResolveAll<TService>(Arguments arguments)

Returns component instances that implement TService

public TService[] ResolveAll<TService>()

Returns component instances that implement TService

protected object ResolveComponent(IHandler handler, Type service, Arguments additionalArguments, IReleasePolicy policy)

protected virtual IHandler WrapParentHandler(IHandler parentHandler)