RE: RequiredModelMBean bug?

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

you know how much I like ModelMBeans, and RMMB especially...
There is a clear overlapping between the management interface of the resource (managed by the RMMB) and the RMMB itself.
Am I allowed to call setModelMBeanInfo() via MBeanServer if that attribute is not exposed via MBeanAttributeInfo ?
I don't know the answer.

Frankly, I would avoid RMMB as much as possible.

For the rest, do whatever it seems more logical to you, I have no objections.

Simon

> Is it possible to call createMBean() on 
> javax.management.modelmbean.RequiredModelMBean ?
> Right now it throws a NotCompliantMBeanException because 
> there's no ModelMBeanInfo. 
> The spec says the RequiredModelMBean instance must be instantiated 
> but not yet registered when you call setModelMBeanInfo() on it. 
> But it doesn't say that you *have* to call setModelMBeanInfo() 
> before you register it. 
> Apparently, however, the RI does behave that way. 
> If you change RequiredModelMBean's load() method to this: 

public void load() throws MBeanException, RuntimeOperationsException, InstanceNotFoundException 
{ 
  PersisterMBean persister = findPersister(); 
  if (persister == null) 
  { 
    ModelMBeanInfo info = new ModelMBeanInfoSupport( 
                              this.getClass().getName(), 
                              "Default RequiredModelMBean", 
                              null, 
                              null, 
                              null, 
                              null); 
    setModelMBeanInfo(info); 
  } 
  else 
  { 
    ModelMBeanInfo info = (ModelMBeanInfo)persister.load(); 
    setModelMBeanInfo(info); 
  } 
} 

> it fixes the problem. 
> Do you have any objections to making that change? 
> Any other suggestions? 



-------------------------------------------------------
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.