public static void unregister ( ObjectName objectName ) throws MBeanException { try { // Get the MBean server. MBeanServer mBeanServer = ManagementFactory . getPlatformMBeanServer ( ) ; // Check if the MBean is registered with the MBean server. if ( mBeanServer . isRegistered ( objectName ) ) { // Unregister the MBean with the MBean server. mBeanServer . unregisterMBean ( objectName ) ; } } catch ( Exception e ) { throw new MBeanException ( e , "Unable to unregister the MBean " + objectName . getCanonicalName ( ) + "." ) ; } }
Unregister the MBean represented by the object name .