Hello Simon

I have a facility because the additional handlers are coming from a plugin.

Is there any other way because I really do not want to resolve handlers on 
publish. The handlers are always the same and they are initialized upfront 
because this is a web application. For winforms is other story.

10x

On Thursday, March 22, 2012 3:03:36 PM UTC+2, Simon wrote:
>
> 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 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/-/S9D4PeYsc7AJ.
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