public static MBeanServer getMBeanServer ( String domain ) { try { ArrayList < MBeanServer > l = MBeanServerFactory . findMBeanServer ( null ) ; if ( l != null ) { for ( MBeanServer ms : l ) { String [ ] domains = ms . getDomains ( ) ; if ( domains != null ) { for ( String d : domains ) { if ( domain . equals ( d ) ) { return ms ; } } } } } } catch ( SecurityException se ) { // Ignore } return null ; }
Get the MBeanServer instance