@Test public void testFindJdkDynamicProxyFactory() { ProxyFactory proxyFactory = new ProxyFactory(); Bmw bmw = new Bmw(); TargetSource targetSource = new SingletonTargetSource(bmw); proxyFactory.setTargetSource(targetSource); Class<?>[] targetInterfaces = ClassUtils.getAllInterfacesForClass(bmw.getClass()); for (Class<?> targetInterface : targetInterfaces) { proxyFactory.addInterface(targetInterface); } Advisor[] advisors = new Advisor[1]; advisors[0] = advisorAdapterRegistry.wrap(new TestMethodInterceptor()); proxyFactory.addAdvisors(advisors); Car proxy = (Car) proxyFactory.getProxy(); SpringProxyUtils.findJdkDynamicProxyFactory(proxy); }
public static ProxyFactory findJdkDynamicProxyFactory(Object proxy) { InvocationHandler h = Proxy.getInvocationHandler(proxy); ConfigurablePropertyAccessor accessor = PropertyAccessorFactory.forDirectFieldAccess(h); return (ProxyFactory) accessor.getPropertyValue("advised"); }
SpringProxyUtils { public static ProxyFactory findJdkDynamicProxyFactory(Object proxy) { InvocationHandler h = Proxy.getInvocationHandler(proxy); ConfigurablePropertyAccessor accessor = PropertyAccessorFactory.forDirectFieldAccess(h); return (ProxyFactory) accessor.getPropertyValue("advised"); } }
SpringProxyUtils { public static ProxyFactory findJdkDynamicProxyFactory(Object proxy) { InvocationHandler h = Proxy.getInvocationHandler(proxy); ConfigurablePropertyAccessor accessor = PropertyAccessorFactory.forDirectFieldAccess(h); return (ProxyFactory) accessor.getPropertyValue("advised"); }  }
SpringProxyUtils { public static ProxyFactory findJdkDynamicProxyFactory(Object proxy) { InvocationHandler h = Proxy.getInvocationHandler(proxy); ConfigurablePropertyAccessor accessor = PropertyAccessorFactory.forDirectFieldAccess(h); return (ProxyFactory) accessor.getPropertyValue("advised"); }  static T getRealTarget(Object proxy); static boolean isMultipleProxy(Object proxy); static ProxyFactory findJdkDynamicProxyFactory(Object proxy); static ProxyFactory findCglibProxyFactory(Object proxy); static boolean isTransactional(Object proxy); static void removeTransactional(Object proxy); static boolean isAsync(Object proxy); static void removeAsync(Object proxy); }
SpringProxyUtils { public static ProxyFactory findJdkDynamicProxyFactory(Object proxy) { InvocationHandler h = Proxy.getInvocationHandler(proxy); ConfigurablePropertyAccessor accessor = PropertyAccessorFactory.forDirectFieldAccess(h); return (ProxyFactory) accessor.getPropertyValue("advised"); }  static T getRealTarget(Object proxy); static boolean isMultipleProxy(Object proxy); static ProxyFactory findJdkDynamicProxyFactory(Object proxy); static ProxyFactory findCglibProxyFactory(Object proxy); static boolean isTransactional(Object proxy); static void removeTransactional(Object proxy); static boolean isAsync(Object proxy); static void removeAsync(Object proxy);  }