AbstractHandler
public abstract class AbstractHandler : IHandler, ISubDependencyResolver, IExposeDependencyInfo, IDisposable
Implements the basis of
IHandler
Lifestyle manager instance
Gets the component model.
Gets the handler state.
Constructs and initializes the handler
Invoked by
EnsureDependenciesCanBeSatisfied
in order to check if a dependency can be satisfied.
If not, the handler is set to a 'waiting dependency' state.
public virtual bool CanResolve(CreationContext context, ISubDependencyResolver contextHandlerResolver, ComponentModel model, DependencyModel dependency)
Creates an implementation of
ILifestyleManager
based
on
LifestyleType
and invokes
Init
to initialize the newly created manager.
Invoked by the kernel
when one of registered dependencies were satisfied by
new components registered.
Checks if the handler is able to, at very least, satisfy
the dependencies for the constructor with less parameters
Saves the kernel instance, subscribes to
AddedAsChildKernel
event,
creates the lifestyle manager instance and computes
the handler state.
Returns human readable list of dependencies
this handler is waiting for.
Invoked when the container receives a parent container reference.
disposes the component instance (or recycle it).
Should be implemented by derived classes:
disposes the component instance (or recycle it)
Returns an instance of the component this handler
is responsible for
public virtual object Resolve(CreationContext context, ISubDependencyResolver contextHandlerResolver, ComponentModel model, DependencyModel dependency)
Returns an instance of the component this handler
is responsible for
protected abstract object ResolveCore(CreationContext context, bool requiresDecommission, bool instanceRequired)
Should be implemented by derived classes:
returns an instance of the component this handler
is responsible for