RE: MX4JMBeanServerDelegate?

"Bordet, Simone" <[email protected]>
Newsgroups gmane.comp.java.mx4j.devel
Message-ID <[email protected]>
Hi Ward,

> What's the reasoning behind having an 
> MX4J-specific extension of MBeanServerDelegate? 
>
> It seems reasonable, though it's not clear the 
> spec requires it, to expect that the following 
> code would yield 'true': 
>
> ObjectInstance delegateoi = 
> new ObjectInstance("JMImplementation:type=MBeanServerDelegate", 
> "javax.management.MBeanServerDelegate"); 
> Set s = mbs.queryMBeans(new ObjectName(
> "JMImplementation:type=MBeanServerDelegate"), null); 
> delegateoi.equals((ObjectInstance) s.toArray()[0]); 
>
> but it doesn't in MX4J. Looking at the code it appears 
> that the reason may have something to do with the 
> MBeanServerBuilder. Anyone care to enlighten me? 

IMHO the test above is wrong.
The JMX spec states at page 135:

"The MBeanServerDelegate can be the standard
javax.management.MBeanServerDelegate, or a custom subclass, for example,
to override the ImplementationName attribute."

The context in which that sentence is said is when the mechanism of the MBeanServerBuilder is explained. 

Since this mechanism is in place, and indeed the MBeanServer Delegate can be a different class than javax.management.MBeanServerDelegate, the test looks wrong to me.

The reason MX4J has a custom delegate subclass is exactly to support the MBeanServerBuilder feature.

Simon


-------------------------------------------------------
This SF.net email sponsored by: Enterprise Linux Forum Conference & Expo
The Event For Linux Datacenter Solutions & Strategies in The Enterprise 
Linux in the Boardroom; in the Front Office; & in the Server Room 
http://www.enterpriselinuxforum.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.