Accessing an MBean Programmatically
Hi can anybody tell me how access an mbean by a sample program .
For example in case of jboss , the jboss-service.xml contains an entry like the following...
*****************
<mbean code="org.jboss.jmx.adaptor.rmi.RMIAdaptorService"
name="jboss.jmx:type=Connector,name=RMI">
<!-- Bind the RMIAdaptor to JNDI name jmx/rmi/RMIAdaptor -->
<attribute name="JndiName">jmx/rmi/RMIAdaptor</attribute>
<!-- Use an anonymous listening port -->
<attribute name="RMIObjectPort">0</attribute>
<!-- Bind on every available interface -->
<attribute name="ServerAddress"></attribute>
</mbean>
*****************
From this I use the part ....
'<attribute name="JndiName">jmx/rmi/RMIAdaptor</attribute>'
i.e. my JNDI Name is jmx/rmi/RMIAdaptor
So in my code it is like ..
MBeanServerConnection server = (MBeanServerConnection) ctx.lookup("jmx/rmi/RMIAdaptor");
Now in case of JCAPS from where I can get the JNDI lookup string name ? If some one has any sample code or doc it will be very helpful for me .
Regards,
Ayan

