本文整理汇总了Java中javax.management.JMX.isMXBeanInterface方法的典型用法代码示例。如果您正苦于以下问题:Java JMX.isMXBeanInterface方法的具体用法?Java JMX.isMXBeanInterface怎么用?Java JMX.isMXBeanInterface使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.management.JMX
的用法示例。
在下文中一共展示了JMX.isMXBeanInterface方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: newProxyInstance
import javax.management.JMX; //导入方法依赖的package包/类
/**
*
* @param member member to which this MBean belongs
* @param monitoringRegion corresponding MonitoringRegion
* @param objectName ObjectName of the MBean
* @param interfaceClass on which interface the proxy to be exposed
* @return Object
* @throws ClassNotFoundException
* @throws IntrospectionException
*/
public static Object newProxyInstance(DistributedMember member,
Region<String, Object> monitoringRegion, ObjectName objectName, Class interfaceClass)
throws ClassNotFoundException, IntrospectionException {
boolean isMXBean = JMX.isMXBeanInterface(interfaceClass);
boolean notificationBroadcaster =
((FederationComponent) monitoringRegion.get(objectName.toString())).isNotificationEmitter();
InvocationHandler handler =
new MBeanProxyInvocationHandler(member, objectName, monitoringRegion, isMXBean);
Class[] interfaces;
if (notificationBroadcaster) {
interfaces =
new Class[] {interfaceClass, ProxyInterface.class, NotificationBroadCasterProxy.class};
} else {
interfaces = new Class[] {interfaceClass, ProxyInterface.class};
}
Object proxy = Proxy.newProxyInstance(MBeanProxyInvocationHandler.class.getClassLoader(),
interfaces, handler);
return interfaceClass.cast(proxy);
}
示例2: prepare
import javax.management.JMX; //导入方法依赖的package包/类
/**
* Ensures that an {@code MBeanServerConnection} is configured and attempts
* to detect a local connection if one is not supplied.
*/
public void prepare() {
synchronized (this.preparationMonitor) {
if (this.server != null) {
this.serverToUse = this.server;
}
else {
this.serverToUse = null;
this.serverToUse = this.connector.connect(this.serviceUrl, this.environment, this.agentId);
}
this.invocationHandler = null;
if (this.useStrictCasing) {
// Use the JDK's own MBeanServerInvocationHandler,
// in particular for native MXBean support on Java 6.
if (JmxUtils.isMXBeanSupportAvailable()) {
this.invocationHandler =
new MBeanServerInvocationHandler(this.serverToUse, this.objectName,
(this.managementInterface != null && JMX.isMXBeanInterface(this.managementInterface)));
}
else {
this.invocationHandler = new MBeanServerInvocationHandler(this.serverToUse, this.objectName);
}
}
else {
// Non-strict casing can only be achieved through custom
// invocation handling. Only partial MXBean support available!
retrieveMBeanInfo();
}
}
}
示例3: getMBeanProxy
import javax.management.JMX; //导入方法依赖的package包/类
public <T> T getMBeanProxy(final ObjectName objectName, final Class<T> mbeanInterface) {
if (DistributedSystemMXBean.class.equals(mbeanInterface)
&& ManagementConstants.OBJECTNAME__DISTRIBUTEDSYSTEM_MXBEAN.equals(objectName.toString())) {
return mbeanInterface.cast(getDistributedSystemMXBean());
} else if (JMX.isMXBeanInterface(mbeanInterface)) {
return JMX.newMXBeanProxy(getMBeanServerConnection(), objectName, mbeanInterface);
} else {
return JMX.newMBeanProxy(getMBeanServerConnection(), objectName, mbeanInterface);
}
}
示例4: getMXInterfaces
import javax.management.JMX; //导入方法依赖的package包/类
/**
* Get interfaces that this class is derived from that are JMX interfaces.
*
* @param configBeanClass
* config bean class
* @return set containing classes
*/
public static Set<Class<?>> getMXInterfaces(final Class<? extends Module> configBeanClass) {
Set<Class<?>> allInterfaces = getAllInterfaces(configBeanClass);
Set<Class<?>> result = new HashSet<>();
for (Class<?> clazz : allInterfaces) {
if (JMX.isMXBeanInterface(clazz)) {
result.add(clazz);
}
}
return result;
}