Created
May 25, 2020 23:29
-
-
Save cleantutorials/fffaf4b00f1902e563c932111d33d78d 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
package com.cleantutorials.jconsole.mbeans; | |
import java.lang.management.ManagementFactory; | |
import javax.management.MBeanServer; | |
import javax.management.ObjectName; | |
public class Main { | |
public static void main(String[] args) throws Exception { | |
MBeanServer server = ManagementFactory.getPlatformMBeanServer(); | |
ObjectName name = new ObjectName("com.cleantutorials.jconsole.mbeans:type=ToDo"); | |
ToDo toDo = new ToDo(); | |
server.registerMBean(toDo, name); | |
Thread.sleep(Long.MAX_VALUE); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment