FileDocCategorySizeDatePackage
ProxyFactory.javaAPI DocGlassfish v2 API3057Fri May 04 22:25:58 BST 2007com.sun.enterprise.admin.util.proxy

ProxyFactory

public class ProxyFactory extends Object

Fields Summary
Constructors Summary
private ProxyFactory()
Creates a new instance of ProxyFactory

    
Methods Summary
public static java.lang.ObjectcreateProxy(java.lang.Class intfc, java.lang.Object handler, Interceptor interceptor)

        if (!intfc.isInterface()) {
            throw new IllegalArgumentException(intfc.getClass()
                    + " is not an interface");
        }
        if (!isImplementing(intfc, handler)) {
            throw new IllegalArgumentException("Handler object " + handler
                    + " is not an instance of " + intfc.getName());
        }
        Object obj = Proxy.newProxyInstance(
                handler.getClass().getClassLoader(),
                new Class[] {intfc},
                new ProxyClass(handler, interceptor));
        return obj;
    
private static booleanisImplementing(java.lang.Class intfc, java.lang.Object obj)

        return intfc.isInstance(obj);