[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jakarta-commons-user
Subject:    [modeler] Problem of creating MBean using mbeans-descriptors
From:       Khue Vu <khuevu () gmail ! com>
Date:       2014-03-31 7:02:09
Message-ID: CAKrZg6VpfBOBt4-CwXSsRnc622miPRHAviWRDjuNeqbvKddJGQ () mail ! gmail ! com
[Download RAW message or body]


Hi,

I am using Apache Modeler to create ModelMBean.
First I register the MBean with the following:

Registry registry = Registry.getRegistry(null, null);
registry.setMBeanServer(ManagementFactory.getPlatformMBeanServer());

InputStream in = this.getClass().getResourceAsStream("/some_mbean.xml");
registry.loadMetadata(in);
...
registry.registerComponent(managedInstance, objectName, null);

With managedInstance is the instance of the managed resource  of the
ModelMBean. (Class of it will be specified in the "*type*" attribute of
mbean element).

When I retrieve the MBean using Registry.findManagedBean or use the
MBeanServer interface directly, the MBean is there. But it has none of the
operations defined in the descriptors (there is only one:
"onSuccessfulCommit" method).

Did I miss something ?

Note that I didn't specify the "*className*" attribute of mbean element as
in this example:
http://commons.apache.org/proper/commons-modeler/apidocs/org/apache/commons/modeler/package-summary.htmlin
 which the
*org.apache.catalina.mbeans.GroupMBean* is used.

Thank you,

Khue.



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic