servers=MBeanServerFactory.findMBeanServer(null); if(servers != null && servers.size() > 0) { return (MBeanServer)servers.get(0); } return null;
return (MBeanServer)servers.get(0);
    private MBeanServer getMBeanServer() {        ArrayList servers=MBeanServerFactory.findMBeanServer("jboss"); // return JBoss server if available        if(servers != null && servers.size() > 0) {            return (MBeanServer)servers.get(0);        }                servers=MBeanServerFactory.findMBeanServer(null); // return any available server        if(servers != null && servers.size() > 0) {            return (MBeanServer)servers.get(0);        }        return null;    }