Table of contents
- 1 Properties
- 2 Methods
- 2.1 RemoveChildKernel(IKernel kernel)
- 2.2 AddChildKernel(IKernel kernel)
- 2.3 GetSubSystem(String key) : ISubSystem
- 2.4 AddSubSystem(String key, ISubSystem subsystem)
- 2.5 GetFacilities() : IFacility[]
- 2.6 AddFacility(String key, IFacility facility)
- 2.7 GetAssignableHandlers(Type service) : IHandler[]
- 2.8 GetHandlers(Type service) : IHandler[]
- 2.9 GetHandler(Type service) : IHandler
- 2.10 GetHandler(String key) : IHandler
- 2.11 CreateComponentActivator(ComponentModel model) : IComponentActivator
- 2.12 ReleaseComponent(Object instance)
- 2.13 RegisterCustomDependencies(String key, IDictionary dependencies)
- 2.14 RegisterCustomDependencies(Type service, IDictionary dependencies)
- 2.15 Resolve(String key, IDictionary arguments) : Object
- 2.16 Resolve(Type service, IDictionary arguments) : Object
- 2.17 HasComponent(Type service) : Boolean
- 2.18 HasComponent(String key) : Boolean
- 2.19 RemoveComponent(String key) : Boolean
- 2.20 AddComponentInstance(String key, Type serviceType, Object instance)
- 2.21 AddComponentInstance(String key, Object instance)
- 2.22 AddCustomComponent(ComponentModel model)
- 2.23 AddComponentWithExtendedProperties(String key, Type serviceType, Type classType, IDictionary extendedProperties)
- 2.24 AddComponentWithExtendedProperties(String key, Type classType, IDictionary extendedProperties)
- 2.25 AddComponent(String key, Type serviceType, Type classType, LifestyleType lifestyle, Boolean overwriteLifestyle)
- 2.26 AddComponent(String key, Type serviceType, Type classType, LifestyleType lifestyle)
- 2.27 AddComponent(String key, Type serviceType, Type classType)
- 2.28 AddComponent(String key, Type classType, LifestyleType lifestyle, Boolean overwriteLifestyle)
- 2.29 AddComponent(String key, Type classType, LifestyleType lifestyle)
- 2.30 AddComponent(String key, Type classType)
IKernel API Document
The IKernel interface exposes all the functionality the MicroKernel implements.
It allows you to register components and request them by the key or the service they implemented. It also allow you to register facilities and subsystem, thus augmenting the functionality exposed by the kernel alone to fits your needs.
Properties
| Name | Type | Description |
|---|---|---|
| Item | Object | Returns the component instance by the key |
| Item | Object | Returns the component instance by the service type |
| ComponentModelBuilder | IComponentModelBuilder | Returns the implementation of Castle.MicroKernel.IComponentModelBuilder |
| HandlerFactory | IHandlerFactory | Returns the implementation of Castle.MicroKernel.IHandlerFactory |
| ConfigurationStore | IConfigurationStore | Gets or sets the implementation of Castle.MicroKernel.IConfigurationStore |
| ReleasePolicy | IReleasePolicy | Gets or sets the implementation for Castle.MicroKernel.IReleasePolicy |
| Resolver | IDependencyResolver | Returns the implementation for Castle.MicroKernel.IDependencyResolver |
| ProxyFactory | IProxyFactory | Gets or sets the implementation of Castle.MicroKernel.IProxyFactory allowing different strategies for proxy creation. |
| Parent | IKernel | Returns the parent kernel |
| GraphNodes | GraphNode[] | Graph of components and iteractions. |
Methods
RemoveChildKernel(IKernel kernel)
Remove child kernel
| Parameter | Description |
|---|---|
| kernel |
AddChildKernel(IKernel kernel)
Support for kernel hierarchy
| Parameter | Description |
|---|---|
| kernel |
GetSubSystem(String key) : ISubSystem
Returns an implementation of Castle.MicroKernel.ISubSystem for the specified key.
| Parameter | Description |
|---|---|
| key |
AddSubSystem(String key, ISubSystem subsystem)
Adds (or replaces) an Castle.MicroKernel.ISubSystem
| Parameter | Description |
|---|---|
| key | |
| subsystem |
GetFacilities() : IFacility[]
Returns the facilities registered on the kernel.
AddFacility(String key, IFacility facility)
Adds a Castle.MicroKernel.IFacility to the kernel.
| Parameter | Description |
|---|---|
| key | |
| facility |
GetAssignableHandlers(Type service) : IHandler[]
Return handlers for components that implements the specified service. The check is made using IsAssignableFrom
| Parameter | Description |
|---|---|
| service |
GetHandlers(Type service) : IHandler[]
Return handlers for components that implements the specified service.
| Parameter | Description |
|---|---|
| service |
GetHandler(Type service) : IHandler
Returns the Castle.MicroKernel.IHandler for the specified service.
| Parameter | Description |
|---|---|
| service |
GetHandler(String key) : IHandler
Returns the Castle.MicroKernel.IHandler for the specified component key.
| Parameter | Description |
|---|---|
| key |
CreateComponentActivator(ComponentModel model) : IComponentActivator
Constructs an implementation of Castle.MicroKernel.IComponentActivator for the given Castle.Core.ComponentModel
| Parameter | Description |
|---|---|
| model |
ReleaseComponent(Object instance)
Releases a component instance. This allows the kernel to execute the proper decomission lifecycles on the component instance.
| Parameter | Description |
|---|---|
| instance |
RegisterCustomDependencies(String key, IDictionary dependencies)
Associates objects with a component handler, allowing it to use the specified dictionary when resolving dependencies
| Parameter | Description |
|---|---|
| key | |
| dependencies |
RegisterCustomDependencies(Type service, IDictionary dependencies)
Associates objects with a component handler, allowing it to use the specified dictionary when resolving dependencies
| Parameter | Description |
|---|---|
| service | |
| dependencies |
Resolve(String key, IDictionary arguments) : Object
Returns the component instance by the component key using dynamic arguments
| Parameter | Description |
|---|---|
| key | |
| arguments |
Resolve(Type service, IDictionary arguments) : Object
Returns the component instance by the service type using dynamic arguments
| Parameter | Description |
|---|---|
| service | |
| arguments |
HasComponent(Type service) : Boolean
Returns true if the specified service was registered
| Parameter | Description |
|---|---|
| service |
HasComponent(String key) : Boolean
Returns true if the specified key was registered
| Parameter | Description |
|---|---|
| key |
RemoveComponent(String key) : Boolean
Returns true if the specified component was found and could be removed (i.e. no other component depends on it)
| Parameter | Description |
|---|---|
| key | The component's key |
AddComponentInstance(String key, Type serviceType, Object instance)
Used mostly by facilities. Adds an instance to be used as a component.
| Parameter | Description |
|---|---|
| key | |
| serviceType | |
| instance |
AddComponentInstance(String key, Object instance)
Used mostly by facilities. Adds an instance to be used as a component.
| Parameter | Description |
|---|---|
| key | |
| instance |
AddCustomComponent(ComponentModel model)
Adds a custom made Castle.Core.ComponentModel. Used by facilities.
| Parameter | Description |
|---|---|
| model |
AddComponentWithExtendedProperties(String key, Type serviceType, Type classType, IDictionary extendedProperties)
Adds a concrete class and an interface as a component and specify the extended properties. Used by facilities, mostly.
| Parameter | Description |
|---|---|
| key | |
| serviceType | |
| classType | |
| extendedProperties |
AddComponentWithExtendedProperties(String key, Type classType, IDictionary extendedProperties)
Adds a concrete class as a component and specify the extended properties. Used by facilities, mostly.
| Parameter | Description |
|---|---|
| key | |
| classType | |
| extendedProperties |
AddComponent(String key, Type serviceType, Type classType, LifestyleType lifestyle, Boolean overwriteLifestyle)
Adds a concrete class and an interface as a component with the specified lifestyle.
If you have indicated a lifestyle for the specified classType using attributes, this method will not overwrite that lifestyle. To do that, use the Castle.MicroKernel.IKernel.AddComponent(System.String,System.Type,System.Type,Castle.Core.LifestyleType,System.Boolean) method.
| Parameter | Description |
|---|---|
| key | The key with which to index the component. |
| serviceType | The service System.Type that this component implements. |
| classType | The System.Type of the component. |
| lifestyle | The specified Castle.Core.LifestyleType for the component. |
| overwriteLifestyle | If true, then ignores all other configurations for lifestyle and uses the value in the lifestyle parameter. |
AddComponent(String key, Type serviceType, Type classType, LifestyleType lifestyle)
Adds a concrete class and an interface as a component with the specified lifestyle.
If you have indicated a lifestyle for the specified classType using attributes, this method will not overwrite that lifestyle. To do that, use the Castle.MicroKernel.IKernel.AddComponent(System.String,System.Type,System.Type,Castle.Core.LifestyleType,System.Boolean) method.
| Parameter | Description |
|---|---|
| key | The key with which to index the component. |
| serviceType | The service System.Type that this component implements. |
| classType | The System.Type of the component. |
| lifestyle | The specified Castle.Core.LifestyleType for the component. |
AddComponent(String key, Type serviceType, Type classType)
Adds a concrete class and an interface as a component
| Parameter | Description |
|---|---|
| key | The key with which to index the component. |
| serviceType | The service System.Type that this component implements. |
| classType | The System.Type of the component. |
AddComponent(String key, Type classType, LifestyleType lifestyle, Boolean overwriteLifestyle)
Missing summary
| Parameter | Description |
|---|---|
| key | Missing documentation |
| classType | Missing documentation |
| lifestyle | Missing documentation |
| overwriteLifestyle | Missing documentation |
AddComponent(String key, Type classType, LifestyleType lifestyle)
Adds a concrete class as a component with the specified lifestyle.
If you have indicated a lifestyle for the specified classType using attributes, this method will not overwrite that lifestyle. To do that, use the Castle.MicroKernel.IKernel.AddComponent(System.String,System.Type,Castle.Core.LifestyleType,System.Boolean) method.
| Parameter | Description |
|---|---|
| key | The key with which to index the component. |
| classType | The System.Type of the component. |
| lifestyle | The specified Castle.Core.LifestyleType for the component. |
AddComponent(String key, Type classType)
Adds a concrete class as a component
| Parameter | Description |
|---|---|
| key | |
| classType |