Hi,
Is there an easier way (I mean without the loop! I want to access the value directly...) to get the value of an attribute?
(here is a code sample of what im using now...)
InitialContext ctx = new InitialContext(); ObjectName objectName = new ObjectName("chap2.ex1:service=JNDIMap"); MBeanServer server = MBeanServerLocator.locateJBoss(); MBeanInfo mBeanInfo = server.getMBeanInfo(objectName); MBeanAttributeInfo[] arrAttributeInfo = mBeanInfo.getAttributes(); for(int a = 0; a < arrAttributeInfo.length; a ++) { AttrResultInfo attrResult = Server.getMBeanAttributeResultInfo("chap2.ex1:service=JNDIMap", arrAttributeInfo[a]); String attrValue = attrResult.getAsText(); out.println(attrValue); }
its ok i found it :)
InitialContext ctx = new InitialContext(); ObjectName objectName = new ObjectName("objectName..."); MBeanServer server = MBeanServerLocator.locateJBoss(); out.println(server.getAttribute(objectName, "attrName"));