View Javadoc
1   /*
2    * Copyright 2022-2023 The OSHI Project Contributors
3    * SPDX-License-Identifier: MIT
4    */
5   package oshi.demo.jmx;
6   
7   import java.util.Map;
8   
9   import oshi.demo.jmx.api.JMXOshiAgent;
10  
11  public class CreateJmxOshiAgent {
12      private static ContextRegistrationPlatform platform = new ContextRegistrationPlatform();
13  
14      public static JMXOshiAgent createJmxOshiAgent(Integer port, String host) throws Exception {
15          return JMXOshiAgentServer.getInstance(host, port, null, platform);
16      }
17  
18      public static JMXOshiAgent createJmxOshiAgent(Integer port, String host, Map<String, ?> properties)
19              throws Exception {
20          return JMXOshiAgentServer.getInstance(host, port, properties, platform);
21      }
22  }