I have an application that is started off from a jython script. The application has an object that I have made managable by adding an MBean interface.
(Resource implements ResourceMBean).
Currently I start my application, instanciate Resource and call the follwing code:
MBeanServer server = MBeanServerFactory.createMBeanServer(domain);
RequiredModelMBean model = new RequiredModelMBean();
model.setManagedResource(Resource, "ObjectReference");
model.setModelMBeanInfo(info);
server.registerMBean(model, new ObjectName(ObjectNameString));
This all work well.
My question is how do I convert this to using JBoss instead. Basically instead of using Sun's inplementation.
I can see lots of examples that create an mbean declarative, but I already have a reference to the object I want to manage.
If I start up both JBoss and my application in the same script it seems possible to find the mbeanServer. This seems a bit cumbersome though, is there a more efficient way?
Any suggestions?
thanks
Morten
No,
find the MBean server reference where you want to register your resource to and use its registerMBean() method.
-- Juha