Java Code Examples for sun.management.jmxremote.ConnectorBootstrap#startRemoteConnectorServer()
The following examples show how to use
sun.management.jmxremote.ConnectorBootstrap#startRemoteConnectorServer() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Agent.java From dragonwell8_jdk with GNU General Public License v2.0 | 4 votes |
private static synchronized void startRemoteManagementAgent(String args) throws Exception { if (jmxServer != null) { throw new RuntimeException(getText(INVALID_STATE, "Agent already started")); } try { Properties argProps = parseString(args); Properties configProps = new Properties(); // Load the management properties from the config file // if config file is not specified readConfiguration implicitly // reads <java.home>/lib/management/management.properties String fname = System.getProperty(CONFIG_FILE); readConfiguration(fname, configProps); // management properties can be overridden by system properties // which take precedence Properties sysProps = System.getProperties(); synchronized (sysProps) { configProps.putAll(sysProps); } // if user specifies config file into command line for either // jcmd utilities or attach command it overrides properties set in // command line at the time of VM start String fnameUser = argProps.getProperty(CONFIG_FILE); if (fnameUser != null) { readConfiguration(fnameUser, configProps); } // arguments specified in command line of jcmd utilities // override both system properties and one set by config file // specified in jcmd command line configProps.putAll(argProps); // jcmd doesn't allow to change ThreadContentionMonitoring, but user // can specify this property inside config file, so enable optional // monitoring functionality if this property is set final String enableThreadContentionMonitoring = configProps.getProperty(ENABLE_THREAD_CONTENTION_MONITORING); if (enableThreadContentionMonitoring != null) { ManagementFactory.getThreadMXBean(). setThreadContentionMonitoringEnabled(true); } String jmxremotePort = configProps.getProperty(JMXREMOTE_PORT); if (jmxremotePort != null) { jmxServer = ConnectorBootstrap. startRemoteConnectorServer(jmxremotePort, configProps); startDiscoveryService(configProps); } else { throw new AgentConfigurationError(INVALID_JMXREMOTE_PORT, "No port specified"); } } catch (AgentConfigurationError err) { error(err); } }
Example 2
Source File: Agent.java From TencentKona-8 with GNU General Public License v2.0 | 4 votes |
private static synchronized void startRemoteManagementAgent(String args) throws Exception { if (jmxServer != null) { throw new RuntimeException(getText(INVALID_STATE, "Agent already started")); } try { Properties argProps = parseString(args); Properties configProps = new Properties(); // Load the management properties from the config file // if config file is not specified readConfiguration implicitly // reads <java.home>/lib/management/management.properties String fname = System.getProperty(CONFIG_FILE); readConfiguration(fname, configProps); // management properties can be overridden by system properties // which take precedence Properties sysProps = System.getProperties(); synchronized (sysProps) { configProps.putAll(sysProps); } // if user specifies config file into command line for either // jcmd utilities or attach command it overrides properties set in // command line at the time of VM start String fnameUser = argProps.getProperty(CONFIG_FILE); if (fnameUser != null) { readConfiguration(fnameUser, configProps); } // arguments specified in command line of jcmd utilities // override both system properties and one set by config file // specified in jcmd command line configProps.putAll(argProps); // jcmd doesn't allow to change ThreadContentionMonitoring, but user // can specify this property inside config file, so enable optional // monitoring functionality if this property is set final String enableThreadContentionMonitoring = configProps.getProperty(ENABLE_THREAD_CONTENTION_MONITORING); if (enableThreadContentionMonitoring != null) { ManagementFactory.getThreadMXBean(). setThreadContentionMonitoringEnabled(true); } String jmxremotePort = configProps.getProperty(JMXREMOTE_PORT); if (jmxremotePort != null) { jmxServer = ConnectorBootstrap. startRemoteConnectorServer(jmxremotePort, configProps); startDiscoveryService(configProps); } else { throw new AgentConfigurationError(INVALID_JMXREMOTE_PORT, "No port specified"); } } catch (AgentConfigurationError err) { error(err); } }
Example 3
Source File: Agent.java From jdk8u60 with GNU General Public License v2.0 | 4 votes |
private static synchronized void startRemoteManagementAgent(String args) throws Exception { if (jmxServer != null) { throw new RuntimeException(getText(INVALID_STATE, "Agent already started")); } Properties argProps = parseString(args); Properties configProps = new Properties(); // Load the management properties from the config file // if config file is not specified readConfiguration implicitly // reads <java.home>/lib/management/management.properties String fname = System.getProperty(CONFIG_FILE); readConfiguration(fname, configProps); // management properties can be overridden by system properties // which take precedence Properties sysProps = System.getProperties(); synchronized (sysProps) { configProps.putAll(sysProps); } // if user specifies config file into command line for either // jcmd utilities or attach command it overrides properties set in // command line at the time of VM start String fnameUser = argProps.getProperty(CONFIG_FILE); if (fnameUser != null) { readConfiguration(fnameUser, configProps); } // arguments specified in command line of jcmd utilities // override both system properties and one set by config file // specified in jcmd command line configProps.putAll(argProps); // jcmd doesn't allow to change ThreadContentionMonitoring, but user // can specify this property inside config file, so enable optional // monitoring functionality if this property is set final String enableThreadContentionMonitoring = configProps.getProperty(ENABLE_THREAD_CONTENTION_MONITORING); if (enableThreadContentionMonitoring != null) { ManagementFactory.getThreadMXBean(). setThreadContentionMonitoringEnabled(true); } String jmxremotePort = configProps.getProperty(JMXREMOTE_PORT); if (jmxremotePort != null) { jmxServer = ConnectorBootstrap. startRemoteConnectorServer(jmxremotePort, configProps); startDiscoveryService(configProps); } }
Example 4
Source File: Agent.java From openjdk-jdk8u with GNU General Public License v2.0 | 4 votes |
private static synchronized void startRemoteManagementAgent(String args) throws Exception { if (jmxServer != null) { throw new RuntimeException(getText(INVALID_STATE, "Agent already started")); } try { Properties argProps = parseString(args); Properties configProps = new Properties(); // Load the management properties from the config file // if config file is not specified readConfiguration implicitly // reads <java.home>/lib/management/management.properties String fname = System.getProperty(CONFIG_FILE); readConfiguration(fname, configProps); // management properties can be overridden by system properties // which take precedence Properties sysProps = System.getProperties(); synchronized (sysProps) { configProps.putAll(sysProps); } // if user specifies config file into command line for either // jcmd utilities or attach command it overrides properties set in // command line at the time of VM start String fnameUser = argProps.getProperty(CONFIG_FILE); if (fnameUser != null) { readConfiguration(fnameUser, configProps); } // arguments specified in command line of jcmd utilities // override both system properties and one set by config file // specified in jcmd command line configProps.putAll(argProps); // jcmd doesn't allow to change ThreadContentionMonitoring, but user // can specify this property inside config file, so enable optional // monitoring functionality if this property is set final String enableThreadContentionMonitoring = configProps.getProperty(ENABLE_THREAD_CONTENTION_MONITORING); if (enableThreadContentionMonitoring != null) { ManagementFactory.getThreadMXBean(). setThreadContentionMonitoringEnabled(true); } String jmxremotePort = configProps.getProperty(JMXREMOTE_PORT); if (jmxremotePort != null) { jmxServer = ConnectorBootstrap. startRemoteConnectorServer(jmxremotePort, configProps); startDiscoveryService(configProps); } else { throw new AgentConfigurationError(INVALID_JMXREMOTE_PORT, "No port specified"); } } catch (AgentConfigurationError err) { error(err); } }
Example 5
Source File: Agent.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 4 votes |
private static synchronized void startRemoteManagementAgent(String args) throws Exception { if (jmxServer != null) { throw new RuntimeException(getText(INVALID_STATE, "Agent already started")); } try { Properties argProps = parseString(args); Properties configProps = new Properties(); // Load the management properties from the config file // if config file is not specified readConfiguration implicitly // reads <java.home>/lib/management/management.properties String fname = System.getProperty(CONFIG_FILE); readConfiguration(fname, configProps); // management properties can be overridden by system properties // which take precedence Properties sysProps = System.getProperties(); synchronized (sysProps) { configProps.putAll(sysProps); } // if user specifies config file into command line for either // jcmd utilities or attach command it overrides properties set in // command line at the time of VM start String fnameUser = argProps.getProperty(CONFIG_FILE); if (fnameUser != null) { readConfiguration(fnameUser, configProps); } // arguments specified in command line of jcmd utilities // override both system properties and one set by config file // specified in jcmd command line configProps.putAll(argProps); // jcmd doesn't allow to change ThreadContentionMonitoring, but user // can specify this property inside config file, so enable optional // monitoring functionality if this property is set final String enableThreadContentionMonitoring = configProps.getProperty(ENABLE_THREAD_CONTENTION_MONITORING); if (enableThreadContentionMonitoring != null) { ManagementFactory.getThreadMXBean(). setThreadContentionMonitoringEnabled(true); } String jmxremotePort = configProps.getProperty(JMXREMOTE_PORT); if (jmxremotePort != null) { jmxServer = ConnectorBootstrap. startRemoteConnectorServer(jmxremotePort, configProps); startDiscoveryService(configProps); } else { throw new AgentConfigurationError(INVALID_JMXREMOTE_PORT, "No port specified"); } } catch (AgentConfigurationError err) { error(err); } }
Example 6
Source File: Agent.java From openjdk-jdk9 with GNU General Public License v2.0 | 4 votes |
private static synchronized void startRemoteManagementAgent(String args) throws Exception { if (jmxServer != null) { throw new RuntimeException(getText(INVALID_STATE, "Agent already started")); } try { Properties argProps = parseString(args); configProps = new Properties(); // Load the management properties from the config file // if config file is not specified readConfiguration implicitly // reads <java.home>/conf/management/management.properties String fname = System.getProperty(CONFIG_FILE); readConfiguration(fname, configProps); // management properties can be overridden by system properties // which take precedence Properties sysProps = System.getProperties(); synchronized (sysProps) { configProps.putAll(sysProps); } // if user specifies config file into command line for either // jcmd utilities or attach command it overrides properties set in // command line at the time of VM start String fnameUser = argProps.getProperty(CONFIG_FILE); if (fnameUser != null) { readConfiguration(fnameUser, configProps); } // arguments specified in command line of jcmd utilities // override both system properties and one set by config file // specified in jcmd command line configProps.putAll(argProps); // jcmd doesn't allow to change ThreadContentionMonitoring, but user // can specify this property inside config file, so enable optional // monitoring functionality if this property is set final String enableThreadContentionMonitoring = configProps.getProperty(ENABLE_THREAD_CONTENTION_MONITORING); if (enableThreadContentionMonitoring != null) { ManagementFactory.getThreadMXBean(). setThreadContentionMonitoringEnabled(true); } String jmxremotePort = configProps.getProperty(JMXREMOTE_PORT); if (jmxremotePort != null) { jmxServer = ConnectorBootstrap. startRemoteConnectorServer(jmxremotePort, configProps); startDiscoveryService(configProps); } else { throw new AgentConfigurationError(INVALID_JMXREMOTE_PORT, "No port specified"); } } catch (JdpException e) { error(e); } catch (AgentConfigurationError err) { error(err); } }
Example 7
Source File: Agent.java From jdk8u-jdk with GNU General Public License v2.0 | 4 votes |
private static synchronized void startRemoteManagementAgent(String args) throws Exception { if (jmxServer != null) { throw new RuntimeException(getText(INVALID_STATE, "Agent already started")); } Properties argProps = parseString(args); Properties configProps = new Properties(); // Load the management properties from the config file // if config file is not specified readConfiguration implicitly // reads <java.home>/lib/management/management.properties String fname = System.getProperty(CONFIG_FILE); readConfiguration(fname, configProps); // management properties can be overridden by system properties // which take precedence Properties sysProps = System.getProperties(); synchronized (sysProps) { configProps.putAll(sysProps); } // if user specifies config file into command line for either // jcmd utilities or attach command it overrides properties set in // command line at the time of VM start String fnameUser = argProps.getProperty(CONFIG_FILE); if (fnameUser != null) { readConfiguration(fnameUser, configProps); } // arguments specified in command line of jcmd utilities // override both system properties and one set by config file // specified in jcmd command line configProps.putAll(argProps); // jcmd doesn't allow to change ThreadContentionMonitoring, but user // can specify this property inside config file, so enable optional // monitoring functionality if this property is set final String enableThreadContentionMonitoring = configProps.getProperty(ENABLE_THREAD_CONTENTION_MONITORING); if (enableThreadContentionMonitoring != null) { ManagementFactory.getThreadMXBean(). setThreadContentionMonitoringEnabled(true); } String jmxremotePort = configProps.getProperty(JMXREMOTE_PORT); if (jmxremotePort != null) { jmxServer = ConnectorBootstrap. startRemoteConnectorServer(jmxremotePort, configProps); startDiscoveryService(configProps); } }
Example 8
Source File: Agent.java From hottub with GNU General Public License v2.0 | 4 votes |
private static synchronized void startRemoteManagementAgent(String args) throws Exception { if (jmxServer != null) { throw new RuntimeException(getText(INVALID_STATE, "Agent already started")); } Properties argProps = parseString(args); Properties configProps = new Properties(); // Load the management properties from the config file // if config file is not specified readConfiguration implicitly // reads <java.home>/lib/management/management.properties String fname = System.getProperty(CONFIG_FILE); readConfiguration(fname, configProps); // management properties can be overridden by system properties // which take precedence Properties sysProps = System.getProperties(); synchronized (sysProps) { configProps.putAll(sysProps); } // if user specifies config file into command line for either // jcmd utilities or attach command it overrides properties set in // command line at the time of VM start String fnameUser = argProps.getProperty(CONFIG_FILE); if (fnameUser != null) { readConfiguration(fnameUser, configProps); } // arguments specified in command line of jcmd utilities // override both system properties and one set by config file // specified in jcmd command line configProps.putAll(argProps); // jcmd doesn't allow to change ThreadContentionMonitoring, but user // can specify this property inside config file, so enable optional // monitoring functionality if this property is set final String enableThreadContentionMonitoring = configProps.getProperty(ENABLE_THREAD_CONTENTION_MONITORING); if (enableThreadContentionMonitoring != null) { ManagementFactory.getThreadMXBean(). setThreadContentionMonitoringEnabled(true); } String jmxremotePort = configProps.getProperty(JMXREMOTE_PORT); if (jmxremotePort != null) { jmxServer = ConnectorBootstrap. startRemoteConnectorServer(jmxremotePort, configProps); startDiscoveryService(configProps); } }
Example 9
Source File: Agent.java From openjdk-8-source with GNU General Public License v2.0 | 4 votes |
private static synchronized void startRemoteManagementAgent(String args) throws Exception { if (jmxServer != null) { throw new RuntimeException(getText(INVALID_STATE, "Agent already started")); } Properties argProps = parseString(args); Properties configProps = new Properties(); // Load the management properties from the config file // if config file is not specified readConfiguration implicitly // reads <java.home>/lib/management/management.properties String fname = System.getProperty(CONFIG_FILE); readConfiguration(fname, configProps); // management properties can be overridden by system properties // which take precedence Properties sysProps = System.getProperties(); synchronized (sysProps) { configProps.putAll(sysProps); } // if user specifies config file into command line for either // jcmd utilities or attach command it overrides properties set in // command line at the time of VM start String fnameUser = argProps.getProperty(CONFIG_FILE); if (fnameUser != null) { readConfiguration(fnameUser, configProps); } // arguments specified in command line of jcmd utilities // override both system properties and one set by config file // specified in jcmd command line configProps.putAll(argProps); // jcmd doesn't allow to change ThreadContentionMonitoring, but user // can specify this property inside config file, so enable optional // monitoring functionality if this property is set final String enableThreadContentionMonitoring = configProps.getProperty(ENABLE_THREAD_CONTENTION_MONITORING); if (enableThreadContentionMonitoring != null) { ManagementFactory.getThreadMXBean(). setThreadContentionMonitoringEnabled(true); } String jmxremotePort = configProps.getProperty(JMXREMOTE_PORT); if (jmxremotePort != null) { jmxServer = ConnectorBootstrap. startRemoteConnectorServer(jmxremotePort, configProps); startDiscoveryService(configProps); } }
Example 10
Source File: Agent.java From openjdk-8 with GNU General Public License v2.0 | 4 votes |
private static synchronized void startRemoteManagementAgent(String args) throws Exception { if (jmxServer != null) { throw new RuntimeException(getText(INVALID_STATE, "Agent already started")); } Properties argProps = parseString(args); Properties configProps = new Properties(); // Load the management properties from the config file // if config file is not specified readConfiguration implicitly // reads <java.home>/lib/management/management.properties String fname = System.getProperty(CONFIG_FILE); readConfiguration(fname, configProps); // management properties can be overridden by system properties // which take precedence Properties sysProps = System.getProperties(); synchronized (sysProps) { configProps.putAll(sysProps); } // if user specifies config file into command line for either // jcmd utilities or attach command it overrides properties set in // command line at the time of VM start String fnameUser = argProps.getProperty(CONFIG_FILE); if (fnameUser != null) { readConfiguration(fnameUser, configProps); } // arguments specified in command line of jcmd utilities // override both system properties and one set by config file // specified in jcmd command line configProps.putAll(argProps); // jcmd doesn't allow to change ThreadContentionMonitoring, but user // can specify this property inside config file, so enable optional // monitoring functionality if this property is set final String enableThreadContentionMonitoring = configProps.getProperty(ENABLE_THREAD_CONTENTION_MONITORING); if (enableThreadContentionMonitoring != null) { ManagementFactory.getThreadMXBean(). setThreadContentionMonitoringEnabled(true); } String jmxremotePort = configProps.getProperty(JMXREMOTE_PORT); if (jmxremotePort != null) { jmxServer = ConnectorBootstrap. startRemoteConnectorServer(jmxremotePort, configProps); startDiscoveryService(configProps); } }
Example 11
Source File: Agent.java From jdk8u_jdk with GNU General Public License v2.0 | 4 votes |
private static synchronized void startRemoteManagementAgent(String args) throws Exception { if (jmxServer != null) { throw new RuntimeException(getText(INVALID_STATE, "Agent already started")); } try { Properties argProps = parseString(args); Properties configProps = new Properties(); // Load the management properties from the config file // if config file is not specified readConfiguration implicitly // reads <java.home>/lib/management/management.properties String fname = System.getProperty(CONFIG_FILE); readConfiguration(fname, configProps); // management properties can be overridden by system properties // which take precedence Properties sysProps = System.getProperties(); synchronized (sysProps) { configProps.putAll(sysProps); } // if user specifies config file into command line for either // jcmd utilities or attach command it overrides properties set in // command line at the time of VM start String fnameUser = argProps.getProperty(CONFIG_FILE); if (fnameUser != null) { readConfiguration(fnameUser, configProps); } // arguments specified in command line of jcmd utilities // override both system properties and one set by config file // specified in jcmd command line configProps.putAll(argProps); // jcmd doesn't allow to change ThreadContentionMonitoring, but user // can specify this property inside config file, so enable optional // monitoring functionality if this property is set final String enableThreadContentionMonitoring = configProps.getProperty(ENABLE_THREAD_CONTENTION_MONITORING); if (enableThreadContentionMonitoring != null) { ManagementFactory.getThreadMXBean(). setThreadContentionMonitoringEnabled(true); } String jmxremotePort = configProps.getProperty(JMXREMOTE_PORT); if (jmxremotePort != null) { jmxServer = ConnectorBootstrap. startRemoteConnectorServer(jmxremotePort, configProps); startDiscoveryService(configProps); } else { throw new AgentConfigurationError(INVALID_JMXREMOTE_PORT, "No port specified"); } } catch (AgentConfigurationError err) { error(err); } }
Example 12
Source File: Agent.java From jdk8u-jdk with GNU General Public License v2.0 | 4 votes |
private static synchronized void startRemoteManagementAgent(String args) throws Exception { if (jmxServer != null) { throw new RuntimeException(getText(INVALID_STATE, "Agent already started")); } Properties argProps = parseString(args); Properties configProps = new Properties(); // Load the management properties from the config file // if config file is not specified readConfiguration implicitly // reads <java.home>/lib/management/management.properties String fname = System.getProperty(CONFIG_FILE); readConfiguration(fname, configProps); // management properties can be overridden by system properties // which take precedence Properties sysProps = System.getProperties(); synchronized (sysProps) { configProps.putAll(sysProps); } // if user specifies config file into command line for either // jcmd utilities or attach command it overrides properties set in // command line at the time of VM start String fnameUser = argProps.getProperty(CONFIG_FILE); if (fnameUser != null) { readConfiguration(fnameUser, configProps); } // arguments specified in command line of jcmd utilities // override both system properties and one set by config file // specified in jcmd command line configProps.putAll(argProps); // jcmd doesn't allow to change ThreadContentionMonitoring, but user // can specify this property inside config file, so enable optional // monitoring functionality if this property is set final String enableThreadContentionMonitoring = configProps.getProperty(ENABLE_THREAD_CONTENTION_MONITORING); if (enableThreadContentionMonitoring != null) { ManagementFactory.getThreadMXBean(). setThreadContentionMonitoringEnabled(true); } String jmxremotePort = configProps.getProperty(JMXREMOTE_PORT); if (jmxremotePort != null) { jmxServer = ConnectorBootstrap. startRemoteConnectorServer(jmxremotePort, configProps); startDiscoveryService(configProps); } }
Example 13
Source File: Agent.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 4 votes |
private static synchronized void startRemoteManagementAgent(String args) throws Exception { if (jmxServer != null) { throw new RuntimeException(getText(INVALID_STATE, "Agent already started")); } Properties argProps = parseString(args); Properties configProps = new Properties(); // Load the management properties from the config file // if config file is not specified readConfiguration implicitly // reads <java.home>/lib/management/management.properties String fname = System.getProperty(CONFIG_FILE); readConfiguration(fname, configProps); // management properties can be overridden by system properties // which take precedence Properties sysProps = System.getProperties(); synchronized (sysProps) { configProps.putAll(sysProps); } // if user specifies config file into command line for either // jcmd utilities or attach command it overrides properties set in // command line at the time of VM start String fnameUser = argProps.getProperty(CONFIG_FILE); if (fnameUser != null) { readConfiguration(fnameUser, configProps); } // arguments specified in command line of jcmd utilities // override both system properties and one set by config file // specified in jcmd command line configProps.putAll(argProps); // jcmd doesn't allow to change ThreadContentionMonitoring, but user // can specify this property inside config file, so enable optional // monitoring functionality if this property is set final String enableThreadContentionMonitoring = configProps.getProperty(ENABLE_THREAD_CONTENTION_MONITORING); if (enableThreadContentionMonitoring != null) { ManagementFactory.getThreadMXBean(). setThreadContentionMonitoringEnabled(true); } String jmxremotePort = configProps.getProperty(JMXREMOTE_PORT); if (jmxremotePort != null) { jmxServer = ConnectorBootstrap. startRemoteConnectorServer(jmxremotePort, configProps); startDiscoveryService(configProps); } }