[jboss-user] [Microcontainer] - Re: Acessing Microcontainer Beans in Servlet

adrian@jboss.org do-not-reply at jboss.com
Thu Apr 5 07:58:12 EDT 2007


I don't understand this thread, you guys are talking about completely different things!

If you have a *.beans deployment then that will create the kernel and also
but more importantly, it will parse the xml and populate that kernel with the beans.

Creating your own kernel (as Ales suggested) will just give you your own
empty kernel. Without a "Bean Deployer" nothing is going to populate and even
if it did, they would be different objects to what is constructed by the *.beans.

If you want to get access to the beans from the .beans file
in another context that doesn't have a reference to that kernel 
and doesn't use IOC then you need to use something like the GOF Locator/Singleton
pattern.

Examples of different possible implementations of this are here:
[url]http://anonsvn.jboss.org/repos/jbossas/projects/microcontainer/trunk/kernel/examples/[url]
in the "locator" directory.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4034979#4034979

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4034979



More information about the jboss-user mailing list