Castle.MicroKernel Abstract implementation of . The implementors must only override the InternalCreate and InternalDestroy methods in order to perform their creation and destruction logic. Implements the instance creation logic. The default implementation should rely on an ordinary call to Activator.CreateInstance(). This interface is provided in order to allow custom components to be created using a different logic, such as using a specific factory or builder.
The constructor for implementation have the following signature: ComponentModel model, IKernel kernel, ComponentInstanceDelegate onCreation, ComponentInstanceDelegate onDestruction The Activator should raise the events onCreation and onDestruction in order to correctly implement the contract. Usually the best way of creating a custom activator is by extending the existing ones.
Should return a new component instance. Should perform all necessary work to dispose the instance and/or any resource related to it. Constructs an AbstractComponentActivator Summary description for ComponentActivatorException. Standard implementation of . Handles the selection of the best constructor, fills the writable properties the component exposes, run the commission and decommission lifecycles, etc. Custom implementors can just override the CreateInstance method. Please note however that the activator is responsible for the proxy creation when needed. Summary description for ComponentNotFoundException. Summary description for ComponentRegistrationException. Summary description for KernelException. Base class for facilities. Unit of extension. A facility should use the extension points offered by the kernel to augment its functionality. Used for client side (Expand explanation) Used for server side. Holds the local registry Used for client side. Holds a remote proxy to the server registry Constructs a RemotingFacility Implementors must inspect the component for a given information or parameter. Usually the implementation will look in the configuration property of the model or the service interface, or the implementation looking for something. The kernel instance The component model Client components are not created by the container so there's no point collecting constructor dependencies For each new component registered, some components in the WaitingDependency state may have became valid, so we check them Request the component instance Summary description for ILifecycleConcern. Summary description for FactoryInterceptor. Summary description for TypedFactoryFacility. Base exception to be used by facilities. Implements the basis of Contract for the IHandler, which manages an component state and coordinates its creation and destruction (dispatching to activators, lifestyle managers) Initializes the handler with a reference to the kernel. Implementors should return a valid instance for the component the handler is responsible. It should throw an exception in the case the component can't be created for some reason Implementors should dispose the component instance Gets the state of the handler Gets the model of the component being managed by this handler. Might be implemented by a handler so it can expose access to dependency information which is used to construct meaningful error messages Returns human readable list of dependencies this handler is waiting for. Invoked by the kernel when one of registered dependencies were satisfied by new components registered. Returns human readable list of dependencies this handler is waiting for. Summary description for DefaultHandler. Summary description for DefaultHandlerFactory. Extension point to allow the developer to use his implementation of Summary description for HandlerException. Possible states for a IHandler instance The component can be requested The component can not be requested as it still depending on a external dependency not yet available Summary description for DisposalConcern. Summary description for InitializationConcern. Summary description for SupportInitializeConcern. Pool implementation contract. Implementors should return a component instance. Implementors should release the instance or put it on the pool Initializes the pool to a initial size by requesting n components and then releasing them. Summary description for AbstractLifestyleManager. The ILifestyleManager implements a strategy for a given lifestyle, like singleton, perthread and transient. The responsability of ILifestyleManager is only the management of lifestyle. It should rely on to obtain a new component instance Initializes the ILifestyleManager with the Implementors should return the component instance based on the lifestyle semantic. Implementors should release the component instance based on the lifestyle semantic, for example, singleton components should not be released on a call for release, instead they should release them when disposed is invoked. Summary description for PerThreadLifestyleManager. Implements a Poolable Lifestyle Manager. Summary description for SingletonLifestyleManager. Summary description for TransientLifestyleManager. Uses the ConfigurationStore registered in the kernel to obtain an associated with the component. Queries the kernel's ConfigurationStore for a configuration associated with the component name. Check for a node 'parameters' within the component configuration. For each child it, a ParameterModel is created and added to ComponentModel's Parameters collection Inspect the configuration associated with the component and populates the parameter model collection accordingly This implementation of collects all available constructors and populates them in the model as candidates. The Kernel will pick up one of the candidates according to a heuristic. Only to hold internal constants and get rid of magic numbers and hardcode names. Inspect the component for InterceptorAttribute and the configuration for the interceptors node Inspects the type looking for interfaces that constitutes lifecycle interfaces, defined in the Castle.Model namespace. Checks if the type implements and or interfaces. Inspects the component configuration and the type looking for a definition of lifestyle type. The configuration preceeds whatever is defined in the component. This inspector is not guarantee to always set up an lifestyle type. If nothing could be found it wont touch the model. In this case is up to the kernel to estabish a default lifestyle for components. Seaches for the lifestyle in the configuration and, if unsuccessful look for the lifestyle attribute in the implementation type. Reads the attribute "lifestyle" associated with the component configuration and tries to convert to enum type. If the conversion fails Check if the type expose one of the lifestyle attributes defined in Castle.Model namespace. Check for a node 'methods' within the component configuration. For each child a is created and added to ComponentModel's methods collection This implementation of collects all potential writable puplic properties exposed by the component implementation and populates the model with them. The Kernel might be able to set some of these properties when the component is requested. Adds the properties as optional dependencies of this component. Summary description for DefaultComponentModelBuilder. Implementors must construct a populated instance of ComponentModel by inspecting the component and|or the configuration. Constructs a new ComponentModel by invoking the registered contributors. "To give or supply in common with others; give to a common fund or for a common purpose". The contributor should inspect the component, or even the configuration associated with the component, to add or change information in the model that can be used later. Removes the specified contributor Defines the contract used by the kernel to obtain proxies for components. The implementor must return a proxied instance that dispatch the invocation to the registered interceptors in the model Implementors must create a proxy based on the information exposed by ComponentModel This is a placeholder implementation of . The decision to supply no implementation for is supported by the fact that the MicroKernel should be a thin assembly with the minimal set of features, although extensible. Providing the support for this interface would obligate the user to import another assembly, even if the large majority of simple cases, no use use of interceptors will take place. If you want to use however, see the Windsor container. Summary description for AllComponentsReleasePolicy. Summary description for IReleasePolicy. Only tracks components that have decommission steps registered No tracking of component instances are made. Default implementation for . This implementation is quite simple, but still should be useful for 99% of situations. Implementors should use a strategy to obtain valid references to properties and/or services requested in the dependency model. Implementors should use a strategy to obtain valid references to properties and/or services requested in the dependency model. Should return an instance of a service or property values as specified by the dependency model instance. It is also the responsability of to throw an exception in the case a non-optional dependency could not be resolved. Returns true if the resolver is able to satisfy this dependency. This method is called with a delegate for firing the IKernelEvents.DependencyResolving event. The delegate used to fire the event Try to resolve the dependency by checking the parameters in the model or checking the Kernel for the requested service. Returns true if the resolver is able to satisfy this dependency. Extracts the component name from the a ref strings which is ${something} Summary description for DependencyResolverException. This implementation of does not try to obtain an external configuration by any means. Its only purpose is to serve as a base class for subclasses that might obtain the configuration node from anywhere. A subsystem is used by the MicroKernel to deal with a specific concern. Initializes the subsystem Should perform the termination of the subsystem instance. The contract used by the kernel to obtain external configuration for the components and facilities. Associates a configuration node with a facility key Associates a configuration node with a component key Returns the configuration node associated with the specified facility key. Should return null if no association exists. Returns the configuration node associated with the specified component key. Should return null if no association exists. Returns all configuration nodes for facilities Returns all configuration nodes for components Base implementation of Implements a conversion logic to a type of a set of types. Returns true if this instance of ITypeConverter is able to handle the specified type. Should perform the conversion from the string representation specified to the type specified. Should perform the conversion from the configuration node specified to the type specified. Converts a string representation to an enum value Implements all standard conversions. Convert a type name to a Type instance. Summary description for ConverterException. Composition of all available conversion managers Establish a composition interface and a subsystem. Implementors should delegate the conversion to a instance of a type converter. Register a type converter instance. Node's left Node's right DA Linked List Creates a ComponentName using a name pattern like "service:key=value,key2=value2" Complete name Creates a ComponentName with specified service and properties. Service name Property list. Serialization constructor. Parses the full name extracting the service and properties. Full name. Sets up the service. Can be empty but can't be null. Parses and validate a properties list string like "key=value,key2=value2" and so on. Property list. Validates a properties Hashtable. Property list. Default implementation. Keeps services and key maps as simple hash tables. Does not support a query string. Contract for SubSystem that wishes to keep and coordinate component registration. Implementors should register the key and service pointing to the specified handler Unregister the handler by the given key Unregister the handler by the given service Returns true if there is a component registered for the specified key Returns true if there is a component registered for the specified service Returns the associated with the specified key. Returns an array of that satisfies the specified query. Returns the associated with the specified service. Returns an array of associated with the specified service. Returns all registered. Return s where components are compatible with the specified service. List of handler by key List of handler by service Returns the number of components registered. Associates a with the specified service Associates a with the specified key Map(String, IHandler) to map component keys to Map(Type, IHandler) to map services to Alternative implementation. Extends the default implementation replacing the key support with a more complete ComponentName. Supports queries. The user must register components using the following construction service:properties Where properties is a list of key value pairs (comma separated). Example: protocol:secure=true,version=1.2 The user can then query for components using the same construction: protocol:secure=true Or to return all: protocol:* Holds the keys used by Kernel to register/request a subsystem. Key used for the configuration store subsystem Key used for the conversion manager Key used for the naming subsystem Key used for the resource subsystem Compares if the reference of two objects are equals. Summary description for ReferenceExpressionUtil. Default implementation of . This implementation is complete and also support a kernel hierarchy (sub containers). Summary description for KernelEventSupport. Summary description for IKernelEvents. Event fired when a new component is registered on the kernel. Event fired when a component is removed from the kernel. Event fired after the ComponentModel is created. Allows customizations that may affect the handler. Event fired when the kernel was added as child of another kernel. Event fired before the component is created. Event fired when a component instance destroyed. Event fired when a new handler is registered (it might be in a valid or waiting dependency state) Event fired when a dependency is being resolved, it allows the dependency to be changed, but the client ComponentModel must not be altered. Pending Pending Pending Pending Pending Pending Pending 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. Adds a concrete class as a component Adds a concrete class and an interface as a component Adds a concrete class as a component and specify the extended properties. Used by facilities, mostly. Adds a concrete class and an interface as a component and specify the extended properties. Used by facilities, mostly. Adds a custom made . Used by facilities. Used mostly by facilities. Adds an instance to be used as a component. Used mostly by facilities. Adds an instance to be used as a component. Returns true if the specified component was found and could be removed (i.e. no other component depends on it) The component's key Returns true if the specified key was registered Returns true if the specified service was registered Releases a component instance. This allows the kernel to execute the proper decomission lifecycles on the component instance. Constructs an implementation of for the given Returns the for the specified component key. Returns the for the specified service. Return handlers for components that implements the specified service. Return handlers for components that implements the specified service. The check is made using IsAssignableFrom Adds a to the kernel. Returns the facilities registered on the kernel. Adds (or replaces) an Returns an implementation of for the specified key. Support for kernel hierarchy Returns the component instance by the key Returns the component instance by the Type Returns the implementation of Returns the implementation of Gets or sets the implementation of Returns the implementation for Returns the implementation for Gets or sets the implementation of allowing different strategies for proxy creation. Returns the parent kernel Graph of components and iteractions. The parent kernel, if exists. The implementation of The implementation of The dependency resolver. Implements a policy to control component's disposal that the usef forgot. Holds the implementation of List of registered. Map of subsystems registered. List of sub containers. Constructs a DefaultKernel with no component proxy support. Constructs a DefaultKernel with the specified implementation of and Constructs a DefaultKernel with the specified implementation of Used mostly by facilities. Adds an instance to be used as a component. Used mostly by facilities. Adds an instance to be used as a component. Return handlers for components that implements the specified service. Return handlers for components that implements the specified service. The check is made using IsAssignableFrom Returns the facilities registered on the kernel. Starts the process of component disposal. Graph of components and iteractions. Represents a delegate which holds basic information about a component. Key which identifies the component handler that holds this component and is capable of creating an instance of it. Represents a delegate which holds basic information about a component and its instance. Component meta information Component instance Represents a delegate which holds the information about the component Represents a delegate which holds a handler handler that holds a component and is capable of creating an instance of it. Represents a delegate which holds dependency resolving information.