I set out doing just that but I'm not too thrilled with the results...it's not as simple as AllTypes.Pick(), it's more like:
public virtual void LoadMessageConsumers(params IMessageConsumer[] messageConsumers) { messageConsumers.ForEach(c => this.container.Register(Component.For(c.GetType()).Instance(c))); } Don't know how I feel about that one - basically sacrificing lifestyle/scope capabilities of your chosen container in order to enable brute-force integration...hmmm...does Windsor offer any advanced functionality around this sort of thing that might help? On Sun, May 3, 2009 at 10:45 PM, Ayende Rahien <aye...@ayende.com> wrote: > Patch it :-) > > On Mon, May 4, 2009 at 8:06 AM, Matt Burton <matt.bur...@gmail.com> wrote: >> >> Ah crap. Stop being so...pragmatic. Let us reinvent the wheel >> repeatedly, please!? >> >> Unbelievable - so simple. Here's a thought - for those non-Windsor >> folks you could add a method to the bootstrapper or somewhere that >> takes an IEnumerable<IMessageConsumer> list that would in turn do: >> >> container.Register(AllTypes.Pick(list)); >> >> Add a doc comment directing users as to the purpose, and good to >> go...just a thought... >> >> On Sun, May 3, 2009 at 7:09 PM, Ayende Rahien <aye...@ayende.com> wrote: >> > Rafal, >> > This might be simple: >> > container = new WindsorContainer(); >> > container.AddFacility("rhino.esb", new RsbFacility(); >> > container.Register(AllTypes.Pick( >> > spring.GetAllTypesInheritingFrom(typeof(IMessageConsumer)); >> > done >> > >> > On Mon, May 4, 2009 at 12:13 AM, rg <rafal.gwizd...@gmail.com> wrote: >> >> >> >> Thanks, Ayende. I managed to create the facility programmatically. >> >> Now, why I want to do it at all? If you remember, I complained a bit >> >> about Windsor container dependency. I tried to develop some warmer >> >> feelings towards Windsor, but with very limited success as for now, so >> >> I have instead decided to wrap the RSB and its container (whatever it >> >> is) in a component that would be usable in my environment (which is >> >> Spring IoC). Now the problem to solve is how to pass message handlers >> >> from my container to RSB's windsor container so RSB can find them. But >> >> I have some idea for this also. >> >> I know it's awkward but maybe if I learn a bit about RSB I'll come up >> >> with a better solution. >> >> >> >> R >> >> >> >> On May 3, 8:08 am, Ayende Rahien <aye...@ayende.com> wrote: >> >> > facility config - you need to modify the config on the kernel, not on >> >> > the >> >> > facility >> >> > What kind of config file are we talking about? >> >> > >> >> > On Sun, May 3, 2009 at 6:03 AM, rg <rafal.gwizd...@gmail.com> wrote: >> >> > >> >> > > I wanted to wrap RSB config & startup code in a component that >> >> > > could >> >> > > be configured by my infrastructure so I could maintain single >> >> > > config >> >> > > file. >> >> > > Regarding the creation of facility, I tried creating RSB facility >> >> > > but >> >> > > don't know how to give the config to it - FacilityConfig field is >> >> > > read >> >> > > only. >> >> > >> >> > > R >> >> > >> >> > > On May 3, 1:16 am, Ayende Rahien <aye...@ayende.com> wrote: >> >> > > > You have to create the facility config.You can do this, see >> >> > > > MutableConfiguration. >> >> > > > Or, you can inherit RSBFacility and provide the values >> >> > > > internally. >> >> > >> >> > > > why do you want to do that? RBS is structured so the only config >> >> > > > options >> >> > > are >> >> > > > the admin ones. >> >> > >> >> > > > On Sun, May 3, 2009 at 12:08 AM, nightwatch77 >> >> > > > <rafal.gwizd...@gmail.com >> >> > > >wrote: >> >> > >> >> > > > > Hi, how to configure RSB completely in code, without using any >> >> > > > > XML >> >> > > > > config? >> >> >> > >> > >> > > >> > >> >> > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Rhino Tools Dev" group. To post to this group, send email to rhino-tools-dev@googlegroups.com To unsubscribe from this group, send email to rhino-tools-dev+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rhino-tools-dev?hl=en -~----------~----~----~----~------~----~------~--~---