commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Khue Vu <khu...@gmail.com>
Subject [modeler] Problem of creating MBean using mbeans-descriptors
Date Mon, 31 Mar 2014 07:02:09 GMT
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.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message