1 22 package org.jboss.proxy.compiler; 23 24 import java.io.Serializable ; 25 26 import org.jboss.util.NestedRuntimeException; 27 28 35 public class Proxy 36 { 37 52 public static Object newProxyInstance(final ClassLoader loader, 53 final Class [] interfaces, 54 final InvocationHandler h) 55 { 56 Class [] interfaces2 = new Class [interfaces.length + 1]; 58 System.arraycopy(interfaces, 0, interfaces2, 0, interfaces.length); 59 interfaces2[interfaces2.length - 1] = Serializable .class; 60 61 try { 62 return Proxies.newTarget(loader, h, interfaces2); 64 } 65 catch (Exception e) { 66 throw new NestedRuntimeException("Failed to create new proxy target", e); 67 } 68 } 69 70 public static void forgetProxyForClass(Class clazz) 71 { 72 Proxies.forgetProxyForClass(clazz); 73 } 74 75 } 76 77 | Popular Tags |