当前位置: 首页>>代码示例>>Java>>正文


Java ConnectorBootstrap.startRemoteConnectorServer方法代码示例

本文整理汇总了Java中sun.management.jmxremote.ConnectorBootstrap.startRemoteConnectorServer方法的典型用法代码示例。如果您正苦于以下问题:Java ConnectorBootstrap.startRemoteConnectorServer方法的具体用法?Java ConnectorBootstrap.startRemoteConnectorServer怎么用?Java ConnectorBootstrap.startRemoteConnectorServer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sun.management.jmxremote.ConnectorBootstrap的用法示例。


在下文中一共展示了ConnectorBootstrap.startRemoteConnectorServer方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: startRemoteManagementAgent

import sun.management.jmxremote.ConnectorBootstrap; //导入方法依赖的package包/类
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);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:55,代码来源:Agent.java

示例2: startRemoteManagementAgent

import sun.management.jmxremote.ConnectorBootstrap; //导入方法依赖的package包/类
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);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:63,代码来源:Agent.java

示例3: startRemoteManagementAgent

import sun.management.jmxremote.ConnectorBootstrap; //导入方法依赖的package包/类
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.getError(), err.getParams());
    }
}
 
开发者ID:campolake,项目名称:openjdk9,代码行数:63,代码来源:Agent.java

示例4: startRemoteManagementAgent

import sun.management.jmxremote.ConnectorBootstrap; //导入方法依赖的package包/类
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);
    }
}
 
开发者ID:greghaskins,项目名称:openjdk-jdk7u-jdk,代码行数:54,代码来源:Agent.java


注:本文中的sun.management.jmxremote.ConnectorBootstrap.startRemoteConnectorServer方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。