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 has 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.
Initializes a new instance of the class.
Attempts to dynamically load a UserControl by invoking Page.LoadControl.
There are two uses of this class.
1) Add a component to the Kernel and add a VirtualPath attribute specifying
the relative path of the .ascx file for the associated UserControl. (easy)
<component id="BasketView"
service="Castle.ShoppingCart.IBasketView, Castle.ShoppingCart"
type="Castle.ShoppingCart.BasketView, Castle.ShoppingCart"
lifestyle="transient"
virtualPath="~/Views/BasketView.ascx"
/>
2) Precompile a UserControl and add the pre-compiled class to the Kernel. (hard)
Has not been tested with proxies.
Initializes a new instance of the class.
The model.
The kernel.
The on creation.
The on destruction.
Creates the instance.
The context.
The arguments.
The signature.
Used during a component request, passed along to the whole process.
This allow some data to be passed along the process, which is used
to detected cycled dependency graphs and now it's also being used
to provide arguments to components.
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.
Creation context, which is a resolver itself
Parent resolver
Model of the component that is requesting the dependency
The dependency model
The dependency resolved value or null
Returns true if the resolver is able to satisfy this dependency.
Creation context, which is a resolver itself
Parent resolver
Model of the component that is requesting the dependency
The dependency model
true if the dependency can be satisfied
The list of handlers that are used to resolve
the component.
We track that in order to try to avoid attempts to resolve a service
with itself.
Holds the scoped dependencies being resolved.
If a dependency appears twice on the same scope, we'd have a cycle.
Check if we are now in the middle of resolving this handler,
and as such, we shouldn't try to resolve that.
Creates a new, empty instance.
A new CreationContext should be created every time, as the contexts keeps some state related to dependency resolution.
Pendent
Extends adding and
information. Th MemberInfo is only useful to provide detailed information
on exceptions.
The ComponentModel is required so we can get resolve an object that takes as a parameter itself, but
with difference model. (See IoC 51 for the details)
Exception throw when a circular dependency is detected
Initializes a new instance of the class.
Initializes a new instance of the class.
The message.
Initializes a new instance of the class.
The message.
The inner exception.
Initializes a new instance of the class.
The that holds the serialized object data about the exception being thrown.
The that contains contextual information about the source or destination.
The parameter is .
The class name is or is zero (0).
Exception threw when a request for a component
cannot be satisfied because the component does not
exist in the container
Initializes a new instance of the class.
The name.
Initializes a new instance of the class.
The service.
Initializes a new instance of the class.
The object that holds the serialized object data.
The contextual information about the source or destination.
Exception threw when there is a problem
registering a component
Initializes a new instance of the class.
The message.
Initializes a new instance of the class.
The object that holds the serialized object data.
The contextual information about the source or destination.
Exception threw by Kernel operations that failed
for some reason.
Initializes a new instance of the class.
The message.
Initializes a new instance of the class.
The message.
The inner exception.
Initializes a new instance of the class.
The object that holds the serialized object data.
The contextual information about the source or destination.
Exception that is thrown when a error occurs during the Event Wiring process
Base exception to be used by facilities.
Initializes a new instance of the class.
The message.
Initializes a new instance of the class.
The message.
The inner exception.
Initializes a new instance of the class.
The object that holds the serialized object data.
The contextual information about the source or destination.
Facility to allow components to dynamically subscribe to events offered by
other components. We call the component that offers events publishers and
the components that uses them, subscribers.
A component that wish to subscribe to an event must use the external configuration
adding a node subscribers on the publisher. This node can have multiple entries using the
subscriber node.
This example shows two simple components: one is the event publisher and the other is the
subscriber. The subscription will be done by the facility, using the publisher associated configuration.
The Publisher class:
public class SimplePublisher
{
public event PublishEventHandler Event;
public void Trigger()
{
if (Event != null)
{
Event(this, new EventArgs());
}
}
}
The Subscriber class:
public class SimpleListener
{
private bool _listened;
private object _sender;
public void OnPublish(object sender, EventArgs e)
{
_sender = sender;
_listened = sender != null;
}
public bool Listened
{
get { return _listened; }
}
public object Sender
{
get { return _sender; }
}
}
The configuration file:
]]>
Base class for facilities.
Unit of extension. A facility should use
the extension points offered by the kernel
to augment its functionality.
The custom initialization for the Facility.
It must be overriden.
Initializes the facility. First it performs the initialization common for all
facilities, setting the and the
. After it, the Init method is invoked
and the custom initilization is perfomed.
Terminates the Facility, invokind the and setting
the Kernel to a null reference.
Performs the tasks associated with freeing, releasing, or resetting
the facility resources.
It can be overriden.
Gets the where the facility is registered.
The .
Gets the facility configuration.
The representing
the facility configuration.
Overriden. Initializes the facility, subscribing to the ,
, Kernel events.
Checks if the component we're dealing is a publisher. If it is,
parses the configuration (the subscribers node) getting the event wiring info.
The component model.
Invalid and/or a error in the configuration
Checks if the component we're dealing is a publisher. If it is,
iterates the subscribers starting them and wiring the events.
The component model.
The instance representing the component.
When the subscriber is not found
or
The handler method isn't found
or
The event isn't found
Represents the information about an event.
Initializes a new instance of the class.
Name of the event.
The name of the handler method.
Serves as a hash function for a particular type.
A hash code for the current .
Determines whether the specified is equal to the current .
The to compare with the current .
true if the specified is equal to the current ; otherwise, false.
Gets the name of the event.
The name of the event.
Gets the handler method name.
The handler.
Activates a object connecting to the remote server.
Initializes a new instance of the class.
The model.
The kernel.
The oncreation event handler.
The ondestruction event handler.
Activates a client connecting to the remote server, enforcing the uri and the server activation.
Initializes a new instance of the class.
The model.
The kernel.
The oncreation event handler.
The ondestruction event handler.
Activates a client connecting to the remote server through the .
Initializes a new instance of the class.
The model.
The kernel.
The oncreation envent handler.
The ondestruction event handler.
Activates a client activated object.
Initializes a new instance of the class.
The model.
The kernel.
The oncreation event handler.
The ondestruction event handler.
Activates and publishes a server object.
Initializes a new instance of the class.
The model.
The kernel.
The oncreation event handler.
The ondestruction event handler.
Facility to allow the communication with remote kernel, using the .NET Remoting infraestructure.
TODO
TODO
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
Performs the tasks associated with freeing, releasing, or resetting
the facility resources.
It can be overriden.
Inspects the model looking for remote component configuration. If found,
do the component Remoting configuration.
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
Initializes a new instance of the class.
The converter.
if set to true is a server.
if set to true is a client.
The base URI.
The remote registry.
The local registry.
Client components are not created by the container
so there's no point collecting constructor dependencies
Used in case of generics:
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.
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
Dictionary of String/object used to
associate data with a component dependency.
For example, if you component SmtpServer depends on
host and port, you can add those to this
dictionary and the handler will be able to use them.
TODO: Document this
TODO: Document this
TODO: Document this
Gets the state of the handler
Gets the model of the component being
managed by this handler.
TODO: Document this
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.
list of the dependecies that was already checked, used to avoid cycles.
Dictionary of Type to a list of
Dictionary of key (string) to
Custom dependencies values associated with the handler
Lifestyle manager instance
Constructs and initializes the handler
Saves the kernel instance, subscribes to
event,
creates the lifestyle manager instance and computes
the handler state.
Should be implemented by derived classes:
returns an instance of the component this handler
is responsible for
Should be implemented by derived classes:
disposes the component instance (or recycle it)
TODO: Pendent
TODO: Pendent
TODO: Pendent
Returns human readable list of dependencies
this handler is waiting for.
Creates an implementation of based
on and invokes
to initialize the newly created manager.
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
Invoked by
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
Invoked by the kernel
when one of registered dependencies were satisfied by
new components registered.
Handler for the event
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.
Handler for the event
Gets the handler state.
Gets the component model.
Summary description for DefaultGenericHandler.
TODO: Consider refactoring AbstractHandler moving lifestylemanager
creation to DefaultHandler
Initializes a new instance of the class.
Clone some of the parent componentmodel properties to the generic subhandler.
The following properties are copied:
-
The
-
The
the subhandler
Summary description for DefaultHandler.
Initializes a new instance of the class.
Returns an instance of the component this handler
is responsible for
disposes the component instance (or recycle it)
Summary description for DefaultHandlerFactory.
Extension point to allow the developer
to use his implementation of
Summary description for HandlerException.
Initializes a new instance of the class.
The message.
Initializes a new instance of the class.
The object that holds the serialized object data.
The contextual information about the source or destination.
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
Redirects resolution to the main resolver, and if not found uses
the parent handler.
Initializes a new instance of the class.
The parent handler.
The child resolver.
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 Lifestyle Manager for Web Apps that
create at most one object per web request.
Implements a Poolable Lifestyle Manager.
Summary description for SingletonLifestyleManager.
Summary description for TransientLifestyleManager.
Inspects the component configuration and the type looking for a
definition of component activator type. The configuration preceeds whatever
is defined in the component.
This inspector is not guarantee to always set up an component activator type.
If nothing could be found it wont touch the model. In this case is up to
the kernel to establish a default component activator for components.
Seaches for the component activator in the configuration and, if unsuccessful
look for the component activator attribute in the implementation type.
The kernel instance
The model instance
Reads the attribute "componentActivatorType" associated with the
component configuration and verifies it implements the
interface.
If the type does not implement the proper interface
Check if the type expose one of the component activator attributes
defined in Castle.Core namespace.
Validates that the provide type implements IComponentActivator
The custom component activator.
Inspects the component configuration and type looking for information
that can influence the generation of a proxy for that component.
We specifically look for useSingleInterfaceProxy and marshalByRefProxy
on the component configuration or the
attribute.
Seaches for proxy behavior in the configuration and, if unsuccessful
look for the attribute in
the implementation type.
Reads the proxy behavior associated with the
component configuration/type and applies it to the model.
If the conversion fails
Returns a instance if the type
uses the attribute. Otherwise returns null.
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.
Check if the type expose one of the lifestyle attributes
defined in Castle.Model namespace.
Base for inspectors that want configuration associated with methods.
For each child a is created
and added to ComponentModel's methods collection
Implementors should override the return
the name of the node to be inspected. For example:
]]>
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.
Initializes a new instance of the class.
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
Initializes a new instance of the class.
The kernel.
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
Initializes the default contributors.
Gets the contributors.
The contributors.
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
The kernel instance
The component model
The component instance to be proxy (only required in some cases)
array of parameters to the constructor (if any)
proxy instance
Implementor should check the component model
and determine if the caller must pass on the component
instance to the proxy
The kernel instance
The component model
true if an instance must be passed to
Used during the target type inspection process.
Implementors have a chance to interfere in the
proxy generation process
Invoked by the generation process to know if
the specified member should be proxied
Invoked by the generation process to notify that a
member wasn't marked as virtual.
Invoked by the generation process to notify
that the whole process is completed.
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.
Holds the keys used by the proxy factories.
Key used to supply custom proxy options.
Represents options to configure proxies.
Initializes a new instance of the class.
Adds the additional interfaces to proxy.
The interfaces.
Equalses the specified obj.
The obj.
true if equal.
Gets the hash code.
Gets or sets the proxy hook.
Determines if the proxied component uses a target.
Determines if the proxied component can change targets.
Determines if the proxied component should only include
the service interface.
Determines if the interface proxied component should inherit
from
Gets the additional interfaces to proxy.
The interfaces.
Helper support for proxy configuration.
Obtains the associated with the .
The component model.
true if the options should be created if not present.
The associated proxy options for the component model.
Describes a set of components to register in the kernel.
Prepares to register types from an assembly.
The assembly name.
The corresponding
Prepares to register types from an assembly.
The assembly.
The corresponding
Prepares to register types from a list of types.
The list of types.
The corresponding
Prepares to register types from a list of types.
The list of types.
The corresponding
Prepares to register types from a list of types.
The list of types.
The corresponding
Describes all the types based on
The base type.
Describes all the types based on type T.
The base type.
Describes any types that are supplied.
Describes how to select a types service.
Uses the base type matched on.
Uses the first interface of a type.
Assigns a custom service selection strategy.
Describes how to register a group of types.
The contract for all registrations with the kernel.
Performs the registration in the .
The kernel.
Initializes a new instance of the TypesDescriptor.
Assigns a conditional predication which must be satisfied.
The predicate to satisfy.
Assigns a conditional predication which must not be satisfied.
The predicate not to satisify.
Allows customized configurations of each matching type.
The configuration action.
Gets the type all types must be based on.
Gets the service descriptor.
Creates a component registration for the
Type of the service.
The component registration.
Creates a component registration for the service type.
The component registration.
Create a component registration for an exisiting
The component model.
The component registration.
Registration for a single component with the kernel.
The service type
Initializes a new instance of the class.
Initializes a new instance of the class
with an existing .
With the overwrite.
With the name.
The name.
With the instance.
The instance.
With the activator.
With the extended properties.
The properties.
With the extended properties.
The properties.
With the custom dependencies.
The dependencies.
With the custom dependencies.
The dependencies.
With the custom dependencies.
The dependencies.
With the custom dependencies.
The dependencies.
With the custom dependencies.
The dependencies.
With the custom dependencies.
The dependencies.
With the service overrides.
The overrides.
With the service overrides.
The overrides.
With the service overrides.
The overrides.
With the configuration parameters.
The parameters.
With the configuration.
The config nodes.
With the interceptors.
The interceptors.
Ases the startable.
Marks the components with one or more actors.
The component actors.
Registers this component with the .
The kernel.
Adds the attribute descriptor.
The key.
The value.
Adds the descriptor.
The descriptor.
Gets the proxy.
The proxy.
Gets the with lifestyle.
The with lifestyle.
Represents a configuration child.
Applies the configuration node.
The configuration.
Represents a configuration attribute.
Applies the configuration node.
The configuration.
Create a with name.
The attribute name.
The new
Represents a named attribute.
Builds the with name/value.
The attribute value.
The new
Builds the with name/value.
The attribute value.
The new
Represents a configuration child.
Create a with name.
The child name.
The new
Represents a named child.
Builds the with name/value.
The child value.
The new
Builds the with name/value.
The child value.
The new
Builds the with name/config.
The child configuration.
The new
Builds the with name/config.
The child nodes.
The new
Applies the configuration node.
The configuration.
Represents a simple child node.
Applies the configuration node.
The configuration.
Represents a complex child node.
Applies the configuration node.
The configuration.
Represents a compound child node.
Applies the configuration node.
The configuration.
Represents a configuration parameter.
Create a with key.
The parameter key.
The new
Gets the parameter key.
Gets the parameter value.
Gets the parameter configuration.
Represents a parameter key.
Builds the with key/value.
The parameter value.
The new
Builds the with key/config.
The parameter configuration.
The new
The parameter key name.
Represents a key/value pair.
Create a with key.
The property key.
The new
Gets the property key.
Gets the property value.
Represents a property key.
Builds the with key/value.
The property value.
The new
The property key name.
Represents a service override.
Creates a with key.
The service override key.
The new
Gets the optional value type specifier.
Represents a service override key.
Builds the with key/value.
The service overeride value.
The new
Builds the with key/values.
The service overeride values.
The new
Builds the with key/values.
The service overeride values.
The new
The value type.
Builds the with key/values.
The service overeride values.
The new
Builds the with key/values.
The service overeride values.
The new
The value type.
Gets the service override key name.
Summary description for AllComponentsReleasePolicy.
Summary description for IReleasePolicy.
Only tracks components that have decommission steps
registered
Initializes a new instance of the class.
No tracking of component instances are made.
Initializes a new instance of the class.
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.
This method is called with a delegate for firing the
IKernelEvents.DependencyResolving event.
The delegate used to fire the event
Registers a sub resolver instance
The subresolver instance
Unregisters a sub resolver instance previously registered
The subresolver instance
Initializes a new instance of the class.
The kernel.
Initializes this instance with the specified dependency delegate.
The dependency delegate.
Registers a sub resolver instance
The subresolver instance
Unregisters a sub resolver instance previously registered
The subresolver instance
Returns true if the resolver is able to satisfy the specified dependency.
Creation context, which is a resolver itself
Parent resolver
Model of the component that is requesting the dependency
The dependency model
true if the dependency can be satisfied
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
-
The dependency is checked within the instance for the component
-
The dependency is checked within the registered s
-
Finally the resolver tries the normal flow
which is using the configuration
or other component to satisfy the dependency
Creation context, which is a resolver itself
Parent resolver
Model of the component that is requesting the dependency
The dependency model
The dependency resolved value or null
Extracts the component name from the a ref strings which is
${something}
This method rebuild the context for the parameter type.
Naive implementation.
Summary description for DependencyResolverException.
Initializes a new instance of the class.
The message.
Initializes a new instance of the class.
The object that holds the serialized object data.
The contextual information about the source or destination.
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
item key
Configuration node
Associates a configuration node with a component key
item key
Configuration node
Associates a configuration node with a bootstrap component key
item key
Configuration node
Adds the child container configuration.
The container's name.
The config.
Returns the configuration node associated with
the specified child container key. Should return null
if no association exists.
item key
Returns the configuration node associated with
the specified facility key. Should return null
if no association exists.
item key
Returns the configuration node associated with
the specified component key. Should return null
if no association exists.
item key
Returns the configuration node associated with
the specified component key. Should return null
if no association exists.
item key
Returns all configuration nodes for facilities
Returns all configuration nodes for components
Returns all configuration nodes for bootstrap components
Gets the child containers configuration nodes.
Initializes a new instance of the class.
Associates a configuration node with a facility key
item key
Configuration node
Associates a configuration node with a component key
item key
Configuration node
Associates a configuration node with a bootstrap component key
Adds the child container configuration.
The key.
The config.
Returns the configuration node associated with
the specified facility key. Should return null
if no association exists.
item key
Returns the configuration node associated with
the specified child container key. Should return null
if no association exists.
item key
Returns the configuration node associated with
the specified component key. Should return null
if no association exists.
item key
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 bootstrap components
Returns all configuration nodes for child containers
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.
Returns true if this instance of ITypeConverter
is able to handle the specified type with the specified
configuration
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.
Returns true if this instance of ITypeConverter
is able to handle the specified type with the specified
configuration
The default behavior is to just pass it to the normal CanHadnleType
peeking into the configuration is used for some advanced functionality
Initializes a new instance of the class.
This interface is needed because we want to isolate ourself from
the generic parameters, so we can work type safe inside the implementations,
and still call from non generic types outside.
Initializes a new instance of the class.
Looks for a on the type to be converted.
If found, the TypeConverter defined by the attribute is used to perform the conversion.
Marker interface that signals that a converter
depends on IKernel to be able to perform
the conversion.
Attempts to utilize an existing for conversion
Creates the target type instance.
The type.
The configuration.
Chooses the first non default constructor. Throws an exception if more than
one non default constructor is found
The chosen constructor, or null if none was found
Converts the constructor parameters.
The constructor.
The configuration.
Converts the property values.
The instance.
The type.
The configuration.
Finds the child (case insensitive).
The config.
The name.
Gets the conversion manager.
The conversion manager.
Converts a string representation to an enum value
Implements all standard conversions.
Convert a type name to a Type instance.
Summary description for ConverterException.
Initializes a new instance of the class.
The message.
Initializes a new instance of the class.
The message.
The inner exception.
Initializes a new instance of the class.
The object that holds the serialized object data.
The contextual information about the source or destination.
Declares a type as being convertible by a and optionally defines the converter to be used
Defines the to be used to convert the type
Defines the to be used to convert the type
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.
Method finds the next biggest node
It assumes Add puts lesser nodes on the right
Node's left
Node's right
Node's parent
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 map as a simple hash table.
Keeps key map as a list dictionary to maintain order.
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 the associated with
the specified key with the service type.
It is expected that this will be used mainly to resolve a generic service
by its key.
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
Items in this dictionary are sorted in insertion order.
Map(Type, IHandler) to map a service
to .
If there is more than a single service of the type, only the first
registered services is stored in this dictionary.
It serve as a fast lookup for the common case of having a single handler for
a type.
Initializes a new instance of the class.
When requesting a component by service, KeySearchNamingSubSystem first
determines if more than one component has been registered for that service.
If not, Default resolution occurs. If so, all of the registered keys for
that service are processed through the provided Predicate to determine which
key to use for service resolution. If no Predicate matches, the default
resolution occurs.
Initializes a new instance of the class.
Initializes a new instance of the class.
The key predicate.
Registers the given handler with the give key.
The key.
The handler.
Unregisters the handler associated with the given key
The key.
Unregisters the handler associated with the given service
The service.
Executes the Predicate against all keys for the registered service to
determine which component to return.
The service.
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:*
Pendent
An implementation of a should
be able to return instances of
for a given resource identifier.
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 when the kernel was removed from being a 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
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
as a component with the specified .
The key with which to index the component.
The of the component.
The specified for the component.
If you have indicated a lifestyle for the specified using
attributes, this method will not overwrite that lifestyle. To do that, use the
method.
Thrown if , or
are .
Thrown if is .
Adds a concrete class
as a component with the specified .
The key with which to index the component.
The of the component.
The specified for the component.
If , then ignores all other configurations
for lifestyle and uses the value in the parameter.
If you have indicated a lifestyle for the specified using
attributes, this method will not overwrite that lifestyle. To do that, use the
method.
Thrown if or
are .
Thrown if is .
Adds a concrete class and an interface
as a component
The key with which to index the component.
The service that this component implements.
The of the component.
Adds a concrete class and an interface
as a component with the specified .
The key with which to index the component.
The service that this component implements.
The of the component.
The specified for the component.
If you have indicated a lifestyle for the specified using
attributes, this method will not overwrite that lifestyle. To do that, use the
method.
Thrown if , , or
are .
Thrown if is .
Adds a concrete class and an interface
as a component with the specified .
The key with which to index the component.
The service that this component implements.
The of the component.
The specified for the component.
If , then ignores all other configurations
for lifestyle and uses the value in the parameter.
If you have indicated a lifestyle for the specified using
attributes, this method will not overwrite that lifestyle. To do that, use the
method.
Thrown if , , or
are .
Thrown if is .
Adds a concrete class as a component
Adds a concrete class
as a component with the specified .
The specified for the component.
If you have indicated a lifestyle for the specified T using
attributes, this method will not overwrite that lifestyle. To do that, use the
method.
Thrown if is .
Adds a concrete class
as a component with the specified .
The specified for the component.
If , then ignores all other configurations
for lifestyle and uses the value in the parameter.
If you have indicated a lifestyle for the specified T using
attributes, this method will not overwrite that lifestyle. To do that, use the
method.
Thrown if is .
Adds a concrete class and an interface
as a component
The service that this component implements.
Adds a concrete class and an interface
as a component with the specified .
The service that this component implements.
The specified for the component.
If you have indicated a lifestyle for the specified T using
attributes, this method will not overwrite that lifestyle. To do that, use the
method.
are .
Thrown if is .
Adds a concrete class and an interface
as a component with the specified .
The service that this component implements.
The specified for the component.
If , then ignores all other configurations
for lifestyle and uses the value in the parameter.
attributes, this method will not overwrite that lifestyle. To do that, use the
method.
are .
Thrown if is .
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.
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.
Used mostly by facilities. Adds an instance
to be used as a component.
Registers the components provided by the s
with the .
The component registrations.
The kernel.
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
Returns the component instance by the service type
Returns all the valid component instances by
the service type
The service type
Arguments to resolve the services
Returns all the valid component instances by
the service type
The service type
Arguments to resolve the services
Returns the component instance by the service type
using dynamic arguments
Returns the component instance by the component key
using dynamic arguments
Returns the component instance by the service type
using dynamic arguments
Service to resolve
Arguments to resolve the services
Returns the component instance by the component key
using dynamic arguments
Key to resolve
Arguments to resolve the services
Returns a component instance by the key
Returns the component instance by the service type
using dynamic arguments
Returns the component instance by the service type
using dynamic arguments
Arguments to resolve the services
Returns the component instance by the component key
Returns a component instance by the key
Component's key
Service type
The Component instance
Returns a component instance by the key
Service type
Component's key
The Component instance
Returns component instances that implement TService
Returns component instances that implement TService
Returns component instances that implement TService
Returns a component instance by the key
Associates objects with a component handler,
allowing it to use the specified dictionary
when resolving dependencies
Associates objects with a component handler,
allowing it to use the specified dictionary
when resolving dependencies
Associates objects with a component handler,
allowing it to use the specified dictionary
when resolving dependencies
Associates objects with a component handler,
allowing it to use the specified dictionary
when resolving dependencies
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.
Creates and adds an facility to the kernel.
The facility type.
Creates and adds an facility to the kernel.
The facility type.
Returns the facilities registered on the kernel.
Adds (or replaces) an
Returns an implementation of
for the specified key.
Support for kernel hierarchy
Remove child kernel
Raise the hanlder registered event, required so
dependant handlers will be notified about their dependant moving
to valid state.
Returns the component instance by the key
Returns the component instance by the service type
Returns the implementation of
Returns the implementation of
Gets or sets the implementation of
Gets or sets 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
Adds a concrete class
as a component with the specified .
The key with which to index the component.
The of the component.
The specified for the component.
If you have indicated a lifestyle for the specified using
attributes, this method will not overwrite that lifestyle. To do that, use the
method.
Thrown if or
are .
Thrown if is .
Adds a concrete class
as a component with the specified .
The key with which to index the component.
The of the component.
The specified for the component.
If , then ignores all other configurations
for lifestyle and uses the value in the parameter.
If you have indicated a lifestyle for the specified using
attributes, this method will not overwrite that lifestyle. To do that, use the
method.
Thrown if or
are .
Thrown if is .
Adds a concrete class and an interface
as a component with the specified .
The key with which to index the component.
The service that this component implements.
The of the component.
The specified for the component.
If you have indicated a lifestyle for the specified using
attributes, this method will not overwrite that lifestyle. To do that, use the
method.
Thrown if , , or
are .
Thrown if is .
Adds a concrete class and an interface
as a component with the specified .
The key with which to index the component.
The service that this component implements.
The of the component.
The specified for the component.
If , then ignores all other configurations
for lifestyle and uses the value in the parameter.
If you have indicated a lifestyle for the specified using
attributes, this method will not overwrite that lifestyle. To do that, use the
method.
Thrown if , , or
are .
Thrown if is .
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.
Adds a concrete class as a component
Adds a concrete class
as a component with the specified .
The specified for the component.
If you have indicated a lifestyle for the specified T using
attributes, this method will not overwrite that lifestyle. To do that, use the
method.
Thrown if is .
Adds a concrete class
as a component with the specified .
The specified for the component.
If , then ignores all other configurations
for lifestyle and uses the value in the parameter.
If you have indicated a lifestyle for the specified T using
attributes, this method will not overwrite that lifestyle. To do that, use the
method.
Thrown if
is
.
Adds a concrete class and an interface
as a component
The service that this component implements.
Adds a concrete class and an interface
as a component with the specified .
The service that this component implements.
The specified for the component.
If you have indicated a lifestyle for the specified T using
attributes, this method will not overwrite that lifestyle. To do that, use the
method.
are .
Thrown if is .
Adds a concrete class and an interface
as a component with the specified .
The service that this component implements.
The specified for the component.
If , then ignores all other configurations
for lifestyle and uses the value in the parameter.
attributes, this method will not overwrite that lifestyle. To do that, use the
method.
are .
Thrown if is .
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.
Registers the components described by the s
with the .
The component registrations.
The kernel.
Returns the component instance by the service type
using dynamic arguments
Returns the component instance by the service type
using dynamic arguments
Returns the component instance by the component key
Returns a component instance by the key
Component's key
Service type
The Component instance
Returns a component instance by the key
Service type
Component's key
The Component instance
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 the component instance by the service type
Returns all the valid component instances by
the service type
The service type
Arguments to resolve the services
Returns all the valid component instances by
the service type
The service type
Arguments to resolve the services
Returns component instances that implement TService
Returns component instances that implement TService
Returns the component instance by the service type
using dynamic arguments
Returns the component instance by the service type
using dynamic arguments
Returns the component instance by the component key
using dynamic arguments
Returns the component instance by the component key
using dynamic arguments
Associates objects with a component handler,
allowing it to use the specified dictionary
when resolving dependencies
Associates objects with a component handler,
allowing it to use the specified dictionary
when resolving dependencies
Associates objects with a component handler,
allowing it to use the specified dictionary
when resolving dependencies
Associates objects with a component handler,
allowing it to use the specified dictionary
when resolving dependencies
Returns a component instance by the key
Returns component instances that implement TService
Returns a component instance by the key
Resolves the specified key.
The key.
The service.
Type of the arguments as anonymous.
Releases a component instance. This allows
the kernel to execute the proper decomission
lifecycles on the component instance.
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.
Gets the service object of the specified type.
A service object of type serviceType.
An object that specifies the type of service object to get.
Gets the service object of the specified type.
A service object of type serviceType.
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.