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.