Hi Mynkow,

One way we do this is to have the InProcessEventBus have a dependency on
IKernel and resolve the dependencies when we publish to the bus.

I'm not sure why you have a facility for this, facilities are use the
extend de container, registrations should be done with an Installer.

Simon

On Thu, Mar 22, 2012 at 7:34 AM, mynkow <[email protected]> wrote:

> Hi people,
>
> I have a web application with internal EventBus. The registration of the
> component is like this:
>
> Component.For<IEventBus>().ImplementedBy<InProcessEventBus>().OnCreate((kernel,
>  eventBus) =>
>                 {
>                     (eventBus as 
> InProcessEventBus).RegisterAllHandlersInAssembly(Assembly.GetAssembly(typeof(IHaveEventHandlers)),
>  type => kernel.Resolve(type));
>
>                 }
>
> As you can see each handler is initialized as a singleton when the Event
> Bus is created. The IWindsorContainer instance is initialized in
> global.asax.
>
> Not the problem.
> I have an external facility which registers additional event handlers.
> Right now I am doing it wrong. I resolve IEventBus instance within the
> facility and call the RegisterAllHandlersInAssembly(...) method.
> The facility is called with all other component registrations in
> global.asax
> Obviously this is wrong and I get an exception that the castle http module
> is not initialized because we are still in global.asax. Can you give me a
> hint how this should be done correctly? What concept am I missing here.
>
> Best regards
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Castle Project Users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/castle-project-users/-/QdFPy_DdnQEJ.
> To post to this group, send email to [email protected]
> .
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/castle-project-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/castle-project-users?hl=en.

Reply via email to