Java 类javax.management.openmbean.CompositeDataInvocationHandler 实例源码

项目:OpenJSharp    文件:DefaultMXBeanMappingFactory.java   
final Object fromCompositeData(CompositeData cd,
                               String[] itemNames,
                               MXBeanMapping[] converters) {
    final Class<?> targetClass = getTargetClass();
    return
        Proxy.newProxyInstance(targetClass.getClassLoader(),
                               new Class<?>[] {targetClass},
                               new CompositeDataInvocationHandler(cd));
}
项目:jdk8u-jdk    文件:DefaultMXBeanMappingFactory.java   
final Object fromCompositeData(CompositeData cd,
                               String[] itemNames,
                               MXBeanMapping[] converters) {
    final Class<?> targetClass = getTargetClass();
    return
        Proxy.newProxyInstance(targetClass.getClassLoader(),
                               new Class<?>[] {targetClass},
                               new CompositeDataInvocationHandler(cd));
}
项目:jdk8u-jdk    文件:MXBeanTest.java   
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);
    }
项目:jdk8u-jdk    文件:MXBeanTest.java   
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);
}
项目:openjdk-jdk10    文件:DefaultMXBeanMappingFactory.java   
final Object fromCompositeData(CompositeData cd,
                               String[] itemNames,
                               MXBeanMapping[] converters) {
    final Class<?> targetClass = getTargetClass();
    return
        Proxy.newProxyInstance(targetClass.getClassLoader(),
                               new Class<?>[] {targetClass},
                               new CompositeDataInvocationHandler(cd));
}
项目:openjdk-jdk10    文件:MXBeanTest.java   
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);
    }
项目:openjdk-jdk10    文件:MXBeanTest.java   
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);
}
项目:openjdk9    文件:DefaultMXBeanMappingFactory.java   
final Object fromCompositeData(CompositeData cd,
                               String[] itemNames,
                               MXBeanMapping[] converters) {
    final Class<?> targetClass = getTargetClass();
    return
        Proxy.newProxyInstance(targetClass.getClassLoader(),
                               new Class<?>[] {targetClass},
                               new CompositeDataInvocationHandler(cd));
}
项目:openjdk9    文件:MXBeanTest.java   
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);
    }
项目:openjdk9    文件:MXBeanTest.java   
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);
}
项目:jdk8u_jdk    文件:DefaultMXBeanMappingFactory.java   
final Object fromCompositeData(CompositeData cd,
                               String[] itemNames,
                               MXBeanMapping[] converters) {
    final Class<?> targetClass = getTargetClass();
    return
        Proxy.newProxyInstance(targetClass.getClassLoader(),
                               new Class<?>[] {targetClass},
                               new CompositeDataInvocationHandler(cd));
}
项目:jdk8u_jdk    文件:MXBeanTest.java   
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);
    }
项目:jdk8u_jdk    文件:MXBeanTest.java   
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);
}
项目:lookaside_java-1.8.0-openjdk    文件:DefaultMXBeanMappingFactory.java   
final Object fromCompositeData(CompositeData cd,
                               String[] itemNames,
                               MXBeanMapping[] converters) {
    final Class<?> targetClass = getTargetClass();
    return
        Proxy.newProxyInstance(targetClass.getClassLoader(),
                               new Class<?>[] {targetClass},
                               new CompositeDataInvocationHandler(cd));
}
项目:lookaside_java-1.8.0-openjdk    文件:MXBeanTest.java   
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);
    }
项目:lookaside_java-1.8.0-openjdk    文件:MXBeanTest.java   
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);
}
项目:infobip-open-jdk-8    文件:DefaultMXBeanMappingFactory.java   
final Object fromCompositeData(CompositeData cd,
                               String[] itemNames,
                               MXBeanMapping[] converters) {
    final Class<?> targetClass = getTargetClass();
    return
        Proxy.newProxyInstance(targetClass.getClassLoader(),
                               new Class<?>[] {targetClass},
                               new CompositeDataInvocationHandler(cd));
}
项目:infobip-open-jdk-8    文件:MXBeanTest.java   
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);
    }
项目:infobip-open-jdk-8    文件:MXBeanTest.java   
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);
}
项目:jdk8u-dev-jdk    文件:DefaultMXBeanMappingFactory.java   
final Object fromCompositeData(CompositeData cd,
                               String[] itemNames,
                               MXBeanMapping[] converters) {
    final Class<?> targetClass = getTargetClass();
    return
        Proxy.newProxyInstance(targetClass.getClassLoader(),
                               new Class<?>[] {targetClass},
                               new CompositeDataInvocationHandler(cd));
}
项目:jdk8u-dev-jdk    文件:MXBeanTest.java   
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);
    }
项目:jdk8u-dev-jdk    文件:MXBeanTest.java   
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);
}
项目:jdk7-jdk    文件:DefaultMXBeanMappingFactory.java   
final Object fromCompositeData(CompositeData cd,
                               String[] itemNames,
                               MXBeanMapping[] converters) {
    final Class<?> targetClass = getTargetClass();
    return
        Proxy.newProxyInstance(targetClass.getClassLoader(),
                               new Class<?>[] {targetClass},
                               new CompositeDataInvocationHandler(cd));
}
项目:jdk7-jdk    文件:MXBeanTest.java   
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);
    }
项目:jdk7-jdk    文件:MXBeanTest.java   
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);
}
项目:openjdk-source-code-learn    文件:DefaultMXBeanMappingFactory.java   
final Object fromCompositeData(CompositeData cd,
                               String[] itemNames,
                               MXBeanMapping[] converters) {
    final Class<?> targetClass = getTargetClass();
    return
        Proxy.newProxyInstance(targetClass.getClassLoader(),
                               new Class<?>[] {targetClass},
                               new CompositeDataInvocationHandler(cd));
}
项目:openjdk-source-code-learn    文件:MXBeanTest.java   
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);
    }
项目:openjdk-source-code-learn    文件:MXBeanTest.java   
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);
}
项目:OLD-OpenJDK8    文件:DefaultMXBeanMappingFactory.java   
final Object fromCompositeData(CompositeData cd,
                               String[] itemNames,
                               MXBeanMapping[] converters) {
    final Class<?> targetClass = getTargetClass();
    return
        Proxy.newProxyInstance(targetClass.getClassLoader(),
                               new Class<?>[] {targetClass},
                               new CompositeDataInvocationHandler(cd));
}
项目:OLD-OpenJDK8    文件:MXBeanTest.java   
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);
    }
项目:OLD-OpenJDK8    文件:MXBeanTest.java   
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);
}
项目:JAVA_UNIT    文件:MXBeanTest.java   
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);
    }
项目:JAVA_UNIT    文件:MXBeanTest.java   
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);
}
项目:openjdk-jdk7u-jdk    文件:DefaultMXBeanMappingFactory.java   
final Object fromCompositeData(CompositeData cd,
                               String[] itemNames,
                               MXBeanMapping[] converters) {
    final Class<?> targetClass = getTargetClass();
    return
        Proxy.newProxyInstance(targetClass.getClassLoader(),
                               new Class<?>[] {targetClass},
                               new CompositeDataInvocationHandler(cd));
}
项目:openjdk-jdk7u-jdk    文件:MXBeanTest.java   
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);
    }
项目:openjdk-jdk7u-jdk    文件:MXBeanTest.java   
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);
}
项目:openjdk-icedtea7    文件:DefaultMXBeanMappingFactory.java   
final Object fromCompositeData(CompositeData cd,
                               String[] itemNames,
                               MXBeanMapping[] converters) {
    final Class<?> targetClass = getTargetClass();
    return
        Proxy.newProxyInstance(targetClass.getClassLoader(),
                               new Class<?>[] {targetClass},
                               new CompositeDataInvocationHandler(cd));
}
项目:openjdk-icedtea7    文件:MXBeanTest.java   
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);
    }
项目:openjdk-icedtea7    文件:MXBeanTest.java   
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);
}
项目:monarch    文件:OpenTypeConverter.java   
final Object fromCompositeData(CompositeData cd, String[] itemNames,
    OpenTypeConverter[] converters) {
  final Class targetClass = getTargetClass();
  return Proxy.newProxyInstance(targetClass.getClassLoader(), new Class[] {targetClass},
      new CompositeDataInvocationHandler(cd));
}