Created
April 21, 2017 13:45
-
-
Save martin-cowie/bed620e20c2f3926df5257f4b0fe61fb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final MBeanServer mbs = ManagementFactory.getPlatformMBeanServer(); | |
Diskspace mbean = new Diskspace(root); | |
try { | |
ObjectName objectName = new ObjectName( "com.acme.diskspace:name=foo" ); | |
mbs.registerMBean( mbean, objectName ); | |
} catch ( Exception ex ) { | |
throw new Error( String.format( "Cannot registry MBean at "%s"", mbean.getObjectName() ), ex ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment