Skip to content

Commit

Permalink
Use platform MBeanServer
Browse files Browse the repository at this point in the history
  • Loading branch information
ar committed Jul 16, 2023
1 parent 5a4a952 commit 6c14c99
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions jpos/src/main/java/org/jpos/q2/Q2.java
Original file line number Diff line number Diff line change
Expand Up @@ -170,20 +170,7 @@ public void run () {
StandardWatchEventKinds.ENTRY_MODIFY,
StandardWatchEventKinds.ENTRY_DELETE
);
/*
* The following code determines whether a MBeanServer exists
* already. If so then the first one in the list is used.
* I have not yet find a way to interrogate the server for
* information other than MBeans so to pick a specific one
* would be difficult.
*/
ArrayList mbeanServerList =
MBeanServerFactory.findMBeanServer(null);
if (mbeanServerList.isEmpty()) {
server = MBeanServerFactory.createMBeanServer(JMX_NAME);
} else {
server = (MBeanServer) mbeanServerList.get(0);
}
server = ManagementFactory.getPlatformMBeanServer();
final ObjectName loaderName = new ObjectName(Q2_CLASS_LOADER);

try {
Expand Down

0 comments on commit 6c14c99

Please sign in to comment.