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


Java JmxUtils.locateMBeanServer方法代码示例

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


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

示例1: connect

import org.springframework.jmx.support.JmxUtils; //导入方法依赖的package包/类
/**
 * Connects to the remote {@code MBeanServer} using the configured {@code JMXServiceURL}:
 * to the specified JMX service, or to a local MBeanServer if no service URL specified.
 * @param serviceUrl the JMX service URL to connect to (may be {@code null})
 * @param environment the JMX environment for the connector (may be {@code null})
 * @param agentId the local JMX MBeanServer's agent id (may be {@code null})
 */
public MBeanServerConnection connect(JMXServiceURL serviceUrl, Map<String, ?> environment, String agentId)
		throws MBeanServerNotFoundException {

	if (serviceUrl != null) {
		if (logger.isDebugEnabled()) {
			logger.debug("Connecting to remote MBeanServer at URL [" + serviceUrl + "]");
		}
		try {
			this.connector = JMXConnectorFactory.connect(serviceUrl, environment);
			return this.connector.getMBeanServerConnection();
		}
		catch (IOException ex) {
			throw new MBeanServerNotFoundException("Could not connect to remote MBeanServer [" + serviceUrl + "]", ex);
		}
	}
	else {
		logger.debug("Attempting to locate local MBeanServer");
		return JmxUtils.locateMBeanServer(agentId);
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:28,代码来源:ConnectorDelegate.java

示例2: afterPropertiesSet

import org.springframework.jmx.support.JmxUtils; //导入方法依赖的package包/类
/**
 * Kick off bean registration automatically when deployed in an
 * {@code ApplicationContext}.
 * @see #registerBeans()
 */
@Override
public void afterPropertiesSet() {
	// If no server was provided then try to find one. This is useful in an environment
	// where there is already an MBeanServer loaded.
	if (this.server == null) {
		this.server = JmxUtils.locateMBeanServer();
	}

	try {
		logger.info("Registering beans for JMX exposure on startup");
		registerBeans();
		registerNotificationListeners();
	}
	catch (RuntimeException ex) {
		// Unregister beans already registered by this exporter.
		unregisterNotificationListeners();
		unregisterBeans();
		throw ex;
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:26,代码来源:MBeanExporter.java

示例3: afterPropertiesSet

import org.springframework.jmx.support.JmxUtils; //导入方法依赖的package包/类
/**
 * Start bean registration automatically when deployed in an
 * {@code ApplicationContext}.
 * @see #registerBeans()
 */
@Override
public void afterPropertiesSet() {
	// If no server was provided then try to find one. This is useful in an environment
	// such as JDK 1.5, Tomcat or JBoss where there is already an MBeanServer loaded.
	if (this.server == null) {
		this.server = JmxUtils.locateMBeanServer();
	}
	try {
		logger.info("Registering beans for JMX exposure on startup");
		registerBeans();
		registerNotificationListeners();
	}
	catch (RuntimeException ex) {
		// Unregister beans already registered by this exporter.
		unregisterNotificationListeners();
		unregisterBeans();
		throw ex;
	}
}
 
开发者ID:panguixiang,项目名称:my-spring-cache-redis,代码行数:25,代码来源:MBeanExporter.java

示例4: afterPropertiesSet

import org.springframework.jmx.support.JmxUtils; //导入方法依赖的package包/类
/**
 * Kick off bean registration automatically when deployed in an
 * {@code ApplicationContext}.
 * @see #registerBeans()
 */
public void afterPropertiesSet() {
	// If no server was provided then try to find one. This is useful in an environment
	// where there is already an MBeanServer loaded.
	if (this.server == null) {
		this.server = JmxUtils.locateMBeanServer();
	}

	try {
		logger.info("Registering beans for JMX exposure on startup");
		registerBeans();
		registerNotificationListeners();
	}
	catch (RuntimeException ex) {
		// Unregister beans already registered by this exporter.
		unregisterNotificationListeners();
		unregisterBeans();
		throw ex;
	}
}
 
开发者ID:deathspeeder,项目名称:class-guard,代码行数:25,代码来源:MBeanExporter.java

示例5: afterPropertiesSet

import org.springframework.jmx.support.JmxUtils; //导入方法依赖的package包/类
@Override
public void afterPropertiesSet() {
	// If no server was provided then try to find one. This is useful in an environment
	// where there is already an MBeanServer loaded.
	if (this.server == null) {
		this.server = JmxUtils.locateMBeanServer();
	}
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:9,代码来源:MBeanExporter.java

示例6: MonitoredMBeanAttributeFactory

import org.springframework.jmx.support.JmxUtils; //导入方法依赖的package包/类
public MonitoredMBeanAttributeFactory(String name, String description,
        String mBeanName, String attributeName) {
    this(name, description, mBeanName, attributeName, null,
            JmxUtils.locateMBeanServer());
}
 
开发者ID:performancecopilot,项目名称:parfait,代码行数:6,代码来源:MonitoredMBeanAttributeFactory.java


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