本文整理汇总了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;
}
示例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);
}
示例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;
}
示例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;
}
}
示例5: JMXTransportRegistry
import javax.management.remote.JMXConnectorProvider; //导入依赖的package包/类
public JMXTransportRegistry() {
transports = Collections.synchronizedMap(new HashMap<String, JMXConnectorProvider>());
jmxTransportListeners = new ListenerList();
}
示例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);