Random JMX stuff

var urlString = "service:jmx:rmi://127.0.0.1/jndi/rmi://127.0.0.1:6996/jmxrmi";
var ManagementFactory = createObject("java","java.lang.management.ManagementFactory");
var MBeanServerConnection = createObject("java","javax.management.MBeanServerConnection");
var ObjectInstance = createObject("java","javax.management.ObjectInstance");
var ObjectName = createObject("java","javax.management.ObjectName");
if(urlString != "") {
    var JMXConnectorFactory = createObject("java","javax.management.remote.JMXConnectorFactory");
    var JMXServiceURL = createObject("java","javax.management.remote.JMXServiceURL");
    var c = JMXConnectorFactory.connect(JMXServiceURL.init(urlString), javacast("null",""));
    var mbs = c.getMBeanServerConnection();
} else {
        var mbs = ManagementFactory.getPlatformMBeanServer();
}
         request.debug(mbs.getMBeanCount());
try{
    for(domain in mbs.getDomains()) {
    var name = ObjectName.init( domain & ":*" );
         var beans = mbs.queryMBeans( name, javaCast("null",""));
        request.debug(domain);
         for(bean in beans.toArray()) {
        request.debug(bean.getObjectName().getKeyProperty("type"));
        request.debug(bean.getClassName());
        request.debug(bean.getObjectName().getKeyPropertyList());
         }
    }
} catch (any e) {

}
if(urlString != "") {
    c.close();
}

Comments (Comment Moderation is enabled. Your comment will not appear until approved.)
BlogCFC was created by Raymond Camden. This blog is running version 5.9.3.000. Contact Blog Owner