本文整理汇总了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...");
}
示例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);
}
示例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);
}
示例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);
}