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


Java Agent.loadManagementProperties方法代码示例

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


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

示例1: main

import sun.management.Agent; //导入方法依赖的package包/类
/**
 * In sun.management.Agent.loadManagementProperties(), call
 * properties.putAll API may fail with ConcurrentModifcationException if the
 * system properties are modified simultaneously by another thread
 *
 * @param args
 * @throws Exception
 */
public static void main(String[] args) throws Exception {
    System.out.println("Start...");

    final Properties properties = System.getProperties();
    Thread t1 = new Thread(new Runnable() {
        public void run() {
            for (int i = 0; i < 100; i++) {
                properties.put(String.valueOf(i), "");
                try {
                    Thread.sleep(1);
                } catch (InterruptedException e) {
                    // do nothing
                }
            }
        }
    });
    t1.start();

    for (int i = 0; i < 10000; i++) {
        Agent.loadManagementProperties();
    }

    System.out.println("Finished...");
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:33,代码来源:AgentCMETest.java

示例2: initialize

import sun.management.Agent; //导入方法依赖的package包/类
/**
 * Initializes and starts the JMX Connector Server.
 * If the com.sun.management.jmxremote.port property is not defined,
 * simply return. Otherwise, attempts to load the config file, and
 * then calls {@link #initialize(java.lang.String, java.util.Properties)}.
 *
 **/
public static synchronized JMXConnectorServer initialize() {

    // Load a new management properties
    final Properties props = Agent.loadManagementProperties();
    if (props == null) {
        return null;
    }

    final String portStr = props.getProperty(PropertyNames.PORT);


    // System.out.println("initializing: {port=" + portStr + ",
    //                     properties="+props+"}");
    return initialize(portStr, props);
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:23,代码来源:ConnectorBootstrap.java

示例3: initialize

import sun.management.Agent; //导入方法依赖的package包/类
/**
 * Initializes and starts the JMX Connector Server.
 * If the com.sun.management.jmxremote.port property is not defined,
 * simply return. Otherwise, attempts to load the config file, and
 * then calls {@link #startRemoteConnectorServer
 *                            (java.lang.String, java.util.Properties)}.
 *
 * This method is used by some jtreg tests.
 **/
 public static synchronized JMXConnectorServer initialize() {

    // Load a new management properties
    final Properties props = Agent.loadManagementProperties();
    if (props == null) {
         return null;
    }

    final String portStr = props.getProperty(PropertyNames.PORT);
    return startRemoteConnectorServer(portStr, props);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:21,代码来源:ConnectorBootstrap.java

示例4: initialize

import sun.management.Agent; //导入方法依赖的package包/类
/**
 * Initializes and starts the SNMP Adaptor Server.
 * If the com.sun.management.snmp.port property is not defined,
 * simply return. Otherwise, attempts to load the config file, and
 * then calls {@link #initialize(java.lang.String, java.util.Properties)}.
 *
 **/
public static synchronized AdaptorBootstrap initialize() {

    // Load a new properties
    final Properties props = Agent.loadManagementProperties();
    if (props == null) return null;

    final String portStr = props.getProperty(PropertyNames.PORT);

    return initialize(portStr,props);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:18,代码来源:AdaptorBootstrap.java


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