Examples of AbsInvocationHandler


Examples of org.ow2.easybeans.proxy.client.AbsInvocationHandler

            isStateful = true;
        }
        Integer serverID = server.getID();

        // Build the handler
        AbsInvocationHandler handler = null;
        if (isLocalProxy) {
            // local handler
            handler = new LocalCallInvocationHandler(serverID, containerID, factoryName, isStateful);
        } else {
            // remote handler
            handler = new ClientRPCInvocationHandler(containerID, factoryName, isStateful);
            try {
                ((ClientRPCInvocationHandler) handler).setRMIEnv(new InitialContext().getEnvironment());
            } catch (NamingException e) {
                throw new IllegalArgumentException("Unable to get environment", e);
            }
        }

        // handler used for getBusinessObject() method
        handler.setBusinessObjectMode(true);

        // Load the interface with the classloader of the thread
        // Get current classloader
        ClassLoader classLoader = interfaceClass.getClassLoader();

        // set the interface class
        handler.setInterfaceClass(interfaceClass);

        // return the proxy
        return (T) Proxy.newProxyInstance(classLoader, new Class[] {interfaceClass}, handler);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.