forked from openrasta/archived-openrasta-legacy
-
Notifications
You must be signed in to change notification settings - Fork 1
Hosting OpenRasta
simonthorogood edited this page Dec 18, 2010
·
1 revision
OpenRasta’s initialization process relies on a host environment. Such a host, implementing the IHost
interface, needs to be registered.
- Host registration through
HostManager.RegisterHost(IHost host)
- Host raises the
Start
event - The host manager queries the host’s
ResolverAccessor
property.- If the property is null, the host manager initializes the default dependency manager
- If the property is not null, the host manager uses the dependency manager provided by the host
- The host manager registers the dependency resolver in itself for the components that rely on controlling their dependencies’ lifetime
- The host manager lets the host register the root dependencies by calling the
ConfigureRootDependencies
method. - The host manager ensures that the minimal dependencies have been registered correctly (see Host root dependencies)
- The host manager intializes the
IDependencyRegistrar
instance registered in the dependency manager, or theDefaultDependencyRegistrar
if none was found. - The host manager lets the host register the leaf dependencies by calling the
ConfigureLeafDependencies
method. - The host manager marks the configuration as complete.
When the host detects a new incoming request, it must raise its IncomingRequest
event with a new instance of an ICommunicationContext
type. The host manager will be responsible for including the context, request and response objects in the container.