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


Java JMX.isMXBeanInterface方法代码示例

本文整理汇总了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);
}
 
开发者ID:ampool,项目名称:monarch,代码行数:35,代码来源:MBeanProxyInvocationHandler.java

示例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();
		}
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:34,代码来源:MBeanClientInterceptor.java

示例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);
  }
}
 
开发者ID:ampool,项目名称:monarch,代码行数:11,代码来源:JmxOperationInvoker.java

示例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;
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:18,代码来源:InterfacesHelper.java


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