RE: [picocontainer-dev] JMX / JNDI and exposing
Konstantin Priblouda <kpriblouda-/[email protected]>
| Newsgroups | gmane.comp.java.picocontainer.devel |
|---|---|
| Message-ID | <[email protected]> |
--- Jörg Schaible <[email protected]> wrote: > Hi Konstantin, > > Konstantin Priblouda wrote on Wednesday, August 22, > 2007 11:23 AM: > > > Hi all, > > > > It seems to me that current approach to exposing > > components to JNDI / JMX is bit of suboptimal. > > > > Currently JMX/JNDI behaviours would expose > component > > on getComponentInstance() ( and if they are > upstack > > from caching, on every getComponentInstance() ) , > and > > there is also visitors which poke adapters to > force > > exposition. > > > > However, biggest problem for those adapters is > that > > they need additional data, which is difficult to > > provide in scripting environment. > > ( JMXExposed requires MBean server, which may be > > unavailable to the moment of script parsing. Not > to > > speak about passing it to xml / beanshell script > in > > builder ) > > > > I would propose to move all the exposing > functionality > > to visitors. > > > > Advantages: > > - simplier scripts, no headaches about initial > > context > > or mbean servers there. > > - explicit control when something is exposed. > > > > Disadvantages: > > - need of explicit call to visitor after > container > > creation ( but it is also current state ) > > > > regards, > > ( > > All this was resolved in the old JMX impl, so I am > simply wondering about this questions! > > - Jörg Not quite. Current implementation of JMXExposed requires MBeanServer & array of mbean providers. And those are not so easy to obtain in a script. (ContainerDeployer receives MBeanServer during its initalisation, but there is no generic way to pass it to underlying script) The same happens with JNDIExposed - it requires initial context to construct reference (but in most cases default one will be sufficient) As for lifecycle, components are exposed automatically upon retrieval from container ( could happen while starting ) - so more control over this would be also fine. And this can be achieved easily with visitor. regards, ----[ Konstantin Pribluda http://www.pribluda.de ]---------------- JTec quality components: http://www.pribluda.de/projects/ ____________________________________________________________________________________ Be a better Heartthrob. Get better relationship answers from someone who knows. Yahoo! Answers - Check it out. http://answers.yahoo.com/dir/?link=list&sid=396545433 --------------------------------------------------------------------- To unsubscribe from this list please visit: http://xircles.codehaus.org/manage_email