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


Java CompositeDataInvocationHandler类代码示例

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


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

示例1: fromCompositeData

import javax.management.openmbean.CompositeDataInvocationHandler; //导入依赖的package包/类
final Object fromCompositeData(CompositeData cd,
                               String[] itemNames,
                               MXBeanMapping[] converters) {
    final Class<?> targetClass = getTargetClass();
    return
        Proxy.newProxyInstance(targetClass.getClassLoader(),
                               new Class<?>[] {targetClass},
                               new CompositeDataInvocationHandler(cd));
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:10,代码来源:DefaultMXBeanMappingFactory.java

示例2: equal

import javax.management.openmbean.CompositeDataInvocationHandler; //导入依赖的package包/类
static boolean equal(Object o1, Object o2, NamedMXBeans namedMXBeans) {
        if (o1 == o2)
            return true;
        if (o1 == null || o2 == null)
            return false;
        if (o1.getClass().isArray()) {
            if (!o2.getClass().isArray())
                return false;
            return deepEqual(o1, o2, namedMXBeans);
        }
        if (o1 instanceof Map) {
            if (!(o2 instanceof Map))
                return false;
            return equalMap((Map) o1, (Map) o2, namedMXBeans);
        }
        if (o1 instanceof CompositeData && o2 instanceof CompositeData) {
            return compositeDataEqual((CompositeData) o1, (CompositeData) o2,
                                      namedMXBeans);
        }
        if (Proxy.isProxyClass(o1.getClass())) {
            if (Proxy.isProxyClass(o2.getClass()))
                return proxyEqual(o1, o2, namedMXBeans);
            InvocationHandler ih = Proxy.getInvocationHandler(o1);
//            if (ih instanceof MXBeanInvocationHandler) {
//                return proxyEqualsObject((MXBeanInvocationHandler) ih,
//                                         o2, namedMXBeans);
            if (ih instanceof MBeanServerInvocationHandler) {
                return true;
            } else if (ih instanceof CompositeDataInvocationHandler) {
                return o2.equals(o1);
                // We assume the other object has a reasonable equals method
            }
        } else if (Proxy.isProxyClass(o2.getClass()))
            return equal(o2, o1, namedMXBeans);
        return o1.equals(o2);
    }
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:37,代码来源:MXBeanTest.java

示例3: proxyEqual

import javax.management.openmbean.CompositeDataInvocationHandler; //导入依赖的package包/类
private static boolean proxyEqual(Object proxy1, Object proxy2,
                                  NamedMXBeans namedMXBeans) {
    if (proxy1.getClass() != proxy2.getClass())
        return proxy1.equals(proxy2);
    InvocationHandler ih1 = Proxy.getInvocationHandler(proxy1);
    InvocationHandler ih2 = Proxy.getInvocationHandler(proxy2);
    if (!(ih1 instanceof CompositeDataInvocationHandler)
        || !(ih2 instanceof CompositeDataInvocationHandler))
        return proxy1.equals(proxy2);
    CompositeData cd1 =
        ((CompositeDataInvocationHandler) ih1).getCompositeData();
    CompositeData cd2 =
        ((CompositeDataInvocationHandler) ih2).getCompositeData();
    return compositeDataEqual(cd1, cd2, namedMXBeans);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:16,代码来源:MXBeanTest.java

示例4: fromCompositeData

import javax.management.openmbean.CompositeDataInvocationHandler; //导入依赖的package包/类
final Object fromCompositeData(CompositeData cd, String[] itemNames,
    OpenTypeConverter[] converters) {
  final Class targetClass = getTargetClass();
  return Proxy.newProxyInstance(targetClass.getClassLoader(), new Class[] {targetClass},
      new CompositeDataInvocationHandler(cd));
}
 
开发者ID:ampool,项目名称:monarch,代码行数:7,代码来源:OpenTypeConverter.java


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