[jboss-user] [Microcontainer] - Re: Get at Kernel from Unmanaged Object

ALRubinger do-not-reply at jboss.com
Thu May 15 19:42:53 EDT 2008


"alesj" wrote : "ALRubinger" wrote : 
  |   | KernelLocator.getKernel() won't do the trick, as I've got no KernelControllerContext to set.
  |   | 
  | Where to you need KCC here?
  | KernelLocator.getKernel gives you Kernel instance, from where you get Controller,
  | ...
  | But this is very ugly, and I've never liked this KL static hack.
  | We should be able to provide integration point in almost all cases, deployers being the right integration point.

And if the POJO has no access to the deployer we've got the same problem?

How about a solution a la JNDI does?  ie:

// Configuration from a "jboss-mc.properties" on the CP
  | org.jboss.mc.McContext context = new McContext();
  | context.getKernel();

"alesj" wrote : "ALRubinger" wrote : 
  |   | Note that the unmanaged object is not instanciated under my control, so it's just a POJO from which I need to access MC.
  |   | 
  | I would still try to push some handle all the way up to this pojo.

Yeah, for now I have a class called "Hack" which puts my MC Bean in a public static variable. :).  The POJO in question is a JNDI ObjectFactory, created on each lookup by JNP Server.

"alesj" wrote : Still need to see what is to do there ...

Cool, lemme know.  This is a requirement of the EJB3 Proxy Component, which is designed to heavily leverage MC as an underlying registry and configuration mechanism.

S,
ALR

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

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



More information about the jboss-user mailing list