Win a copy of Event Streams in Action this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Accessing an MBean in JCAPS

 
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
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!