public static InvocationHandler getInvocationHandler(Object proxy) { checkDefaultFactory(); return defaultFactory.getInvocationHandler(proxy); }
public static Object constructProxy(final Class clazz, final InvocationHandler handler) throws IllegalStateException { final Object instance = Unsafe.allocateInstance(clazz); Unsafe.setValue(getDeclaredField(clazz, BUSSINESS_HANDLER_NAME), instance, handler); Unsafe.setValue(getDeclaredField(clazz, NON_BUSINESS_HANDLER_NAME), instance, NON_BUSINESS_HANDLER); return instance; }
public static Object newProxyInstance(final Class[] interfaces, final InvocationHandler h) throws IllegalAccessException { checkDefaultFactory(); return defaultFactory.newProxyInstance(interfaces, h); }
public static InvocationHandler getInvocationHandler(final Object proxy) { if (LocalBeanProxyFactory.isProxy(proxy.getClass())) { return LocalBeanProxyFactory.getInvocationHandler(proxy); } checkDefaultFactory(); return defaultFactory.getInvocationHandler(proxy); }
public static boolean isProxyClass(final Class cl) { checkDefaultFactory(); return defaultFactory.isProxyClass(cl); }
public static Class getProxyClass(final Class[] interfaces) throws IllegalAccessException { checkDefaultFactory(); return defaultFactory.getProxyClass(interfaces); }
public static Object newProxy(final Class<?> type, final InvocationHandler invocationHandler) { try { return ProxyManager.newProxyInstance(type, new Handler(invocationHandler)); } catch (final IllegalAccessException e) { throw new OpenEJBRuntimeException("illegal access", e); } }
public static synchronized ProxyFactory setDefaultFactory(final String factoryName) { final ProxyFactory newFactory = getFactory(factoryName); if (newFactory == null) { return defaultFactory; } final ProxyFactory oldFactory = defaultFactory; defaultFactory = newFactory; defaultFactoryName = factoryName; return oldFactory; }
public static Object newProxyInstance(final Class interfaceType, final InvocationHandler h) throws IllegalAccessException { return newProxyInstance(new Class[]{interfaceType}, h); }
public static InvocationHandler getInvocationHandler(final Object proxy) { if (LocalBeanProxyFactory.isProxy(proxy.getClass())) { return LocalBeanProxyFactory.getInvocationHandler(proxy); } checkDefaultFactory(); return defaultFactory.getInvocationHandler(proxy); }
public static Object newProxyInstance(final Class[] interfaces, final InvocationHandler h) throws IllegalAccessException { checkDefaultFactory(); return defaultFactory.newProxyInstance(interfaces, h); }
public static boolean isProxyClass(Class cl) { checkDefaultFactory(); return defaultFactory.isProxyClass(cl); }
public static Class getProxyClass(final Class[] interfaces) throws IllegalAccessException { checkDefaultFactory(); return defaultFactory.getProxyClass(interfaces); }
public static Object newProxy(final Class<?> type, final InvocationHandler invocationHandler) { try { return ProxyManager.newProxyInstance(type, new Handler(invocationHandler)); } catch (final IllegalAccessException e) { throw new OpenEJBRuntimeException("illegal access", e); } }
public static Object constructProxy(final Class clazz, final InvocationHandler handler) throws IllegalStateException { final Object instance = Unsafe.allocateInstance(clazz); Unsafe.setValue(getDeclaredField(clazz, BUSSINESS_HANDLER_NAME), instance, handler); Unsafe.setValue(getDeclaredField(clazz, NON_BUSINESS_HANDLER_NAME), instance, NON_BUSINESS_HANDLER); return instance; }
public static synchronized ProxyFactory setDefaultFactory(String factoryName) { ProxyFactory newFactory = getFactory(factoryName); if (newFactory == null) return defaultFactory; ProxyFactory oldFactory = defaultFactory; defaultFactory = newFactory; defaultFactoryName = factoryName; return oldFactory; }
public static Object newProxyInstance(Class[] interfaces, InvocationHandler h) throws IllegalAccessException { checkDefaultFactory(); return defaultFactory.newProxyInstance(interfaces, h); }
public static boolean isProxyClass(final Class cl) { checkDefaultFactory(); return defaultFactory.isProxyClass(cl); }
public static Class getProxyClass(Class[] interfaces) throws IllegalAccessException { checkDefaultFactory(); return defaultFactory.getProxyClass(interfaces); }
public static synchronized ProxyFactory setDefaultFactory(final String factoryName) { final ProxyFactory newFactory = getFactory(factoryName); if (newFactory == null) { return defaultFactory; } final ProxyFactory oldFactory = defaultFactory; defaultFactory = newFactory; defaultFactoryName = factoryName; return oldFactory; }