if(srv.getDefaultDomain().equalsIgnoreCase("jboss"))
if("jboss".equalsIgnoreCase(srv.getDefaultDomain()))
    public static MBeanServer getMBeanServer() {        ArrayList servers=MBeanServerFactory.findMBeanServer(null);        if(servers == null || servers.size() == 0)            return null;        // return 'jboss' server if available        for(int i=0; i < servers.size(); i++) {            MBeanServer srv=(MBeanServer)servers.get(i);            if(srv.getDefaultDomain().equalsIgnoreCase("jboss"))                return srv;        }        // return first available server        return (MBeanServer)servers.get(0);    }