Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
誰かが2つの違いが何であるかを明確にできますか?
Javadocは、私の適切な理解のために本当にあいまいです。
私が気づいたことの1つはManagementFactory.getPlatformMBeanServer()、MBeanを登録するために使用する場合、Jconsoleでそれらを表示できることです。しかし、私が使用する場合はそうではありませんMBeanServerFactory.createMBeanServer()。
ManagementFactory.getPlatformMBeanServer()
MBeanServerFactory.createMBeanServer()
何故ですか?それが唯一の違いですか?
ありがとう。
ManagementFactory.getPlatformMBeanServer()JVM内の既存のMBeanサーバーへの参照を返します。JConsoleは、そのサーバー上のBeanを調べます。
を使用するcreateMBeanServer()と、まったく新しいサーバーが作成されます。JConsoleはそれを認識していないため、登録されているBeanは表示されません。
createMBeanServer()