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


Java JMXConnectorProvider类代码示例

本文整理汇总了Java中javax.management.remote.JMXConnectorProvider的典型用法代码示例。如果您正苦于以下问题:Java JMXConnectorProvider类的具体用法?Java JMXConnectorProvider怎么用?Java JMXConnectorProvider使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: notify

import javax.management.remote.JMXConnectorProvider; //导入依赖的package包/类
/**
 * Notifies the listeners of the add/remove
 *
 * @param jmxConnectorProviders
 * 		the {@link JMXConnectorProvider}s that changed
 * @param event
 * 			the type of change
 */
public void notify(List<JMXConnectorProvider> jmxConnectorProviders, EventType e) {
	this.event = e;

	Object[] copiedListeners = jmxTransportListeners.getListeners();
	for (int i= 0; i < copiedListeners.length; i++) {
		listener = (IJMXTransportListener)copiedListeners[i];
		for(JMXConnectorProvider connector : jmxConnectorProviders) {
			jmxConnectorProvider = connector;
                  SafeRunner.run(this);
		}
	}

	listener = null;
	jmxConnectorProvider = null;
}
 
开发者ID:apache,项目名称:karaf-eik,代码行数:24,代码来源:JMXTransportRegistry.java

示例2: loadTransportConfigurationElements

import javax.management.remote.JMXConnectorProvider; //导入依赖的package包/类
private void loadTransportConfigurationElements(IConfigurationElement[] configElems) {
	for (int j = 0; j < configElems.length; j++) {
		final IConfigurationElement element = configElems[j];
		final String elementName = element.getName();
		String transport;
		if (elementName.equals("transport") //$NON-NLS-1$
				&& null != element.getAttribute("class") //$NON-NLS-1$
				&& null != (transport = element.getAttribute("protocol"))) //$NON-NLS-1$
		{
			try {
				Object obj = element.createExecutableExtension("class"); //$NON-NLS-1$
				if (obj instanceof JMXConnectorProvider) {
					transports.put(transport, (JMXConnectorProvider)obj);
				}
			} catch (CoreException e) {
				KarafWorkbenchActivator.getLogger().error(e.getMessage(), e);
			}
		}
	}

	final List<JMXConnectorProvider> transportsAdded = new ArrayList<JMXConnectorProvider>();
	transportsAdded.addAll(transports.values());

	getJMXTransportrNotifier().notify(transportsAdded, EventType.ADDED);
}
 
开发者ID:apache,项目名称:karaf-eik,代码行数:26,代码来源:JMXTransportRegistry.java

示例3: getConnectorProvider

import javax.management.remote.JMXConnectorProvider; //导入依赖的package包/类
@Override
   public JMXConnectorProvider getConnectorProvider(String key) {
	final JMXConnectorProvider connector = transports.get(key);

	// TODO: Add logging

	return connector;
}
 
开发者ID:apache,项目名称:karaf-eik,代码行数:9,代码来源:JMXTransportRegistry.java

示例4: getJMXConnector

import javax.management.remote.JMXConnectorProvider; //导入依赖的package包/类
@Override
   public JMXConnector getJMXConnector(JMXServiceDescriptor serviceDescriptor) {
	try {
		final String transport = serviceDescriptor.getUrl().getProtocol();

		final JMXConnectorProvider connectorProvider = getConnectorProvider(transport);

		final JMXServiceURL url = getJMXServiceURL(
								serviceDescriptor.getUrl().getHost(),
								serviceDescriptor.getUrl().getPort(),
								serviceDescriptor.getUrl().getProtocol(),
								serviceDescriptor.getDomain());

		Map<String, Object> environment = null;
		if (serviceDescriptor.getUsername() != null) {
			environment = new HashMap<String, Object>();
			String[] credentials = new String[] {
						serviceDescriptor.getUsername(),
						serviceDescriptor.getPassword()
			};
			environment.put(JMXConnector.CREDENTIALS, credentials);
		}

		return connectorProvider.newJMXConnector(url, environment);
	} catch (Exception e) {
		KarafWorkbenchActivator.getLogger().error(e.getMessage(), e);
		return null;
	}
}
 
开发者ID:apache,项目名称:karaf-eik,代码行数:30,代码来源:JMXTransportRegistry.java

示例5: JMXTransportRegistry

import javax.management.remote.JMXConnectorProvider; //导入依赖的package包/类
public JMXTransportRegistry() {
	transports = Collections.synchronizedMap(new HashMap<String, JMXConnectorProvider>());
	jmxTransportListeners = new ListenerList();
}
 
开发者ID:apache,项目名称:karaf-eik,代码行数:5,代码来源:JMXTransportRegistry.java

示例6: getConnectorProvider

import javax.management.remote.JMXConnectorProvider; //导入依赖的package包/类
/**
 * Getter for a {@link JMXConnectorProvider} using its name as a retrieval
 * key
 *
 * @param name the name of the {@code JMXConnectorProvider}
 *
 * @return
 * 		the {@code JMXConnectorProvider} for the given name, or null if it
 * 		does not exist
 */
public JMXConnectorProvider getConnectorProvider(String name);
 
开发者ID:apache,项目名称:karaf-eik,代码行数:12,代码来源:IJMXTransportRegistry.java


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