本文整理汇总了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));
}
示例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);
}
示例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);
}
示例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));
}