Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Accessing an MBean in JCAPS

 
Ayan Dutta
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 Dutta
 
Ayan Dutta
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any hint from anybody ?
Regards,
Ayan
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic