Serializable session = null;
Class<SimpleInterface> businessInterface = SimpleInterface.class;
InvocationHandler handler = new EndpointInvocationHandler(endpoint, session, businessInterface);
ProxyFactory factory = new ProxyFactory();
factory.setHandler(new MethodHandlerAdapter(handler));
factory.setInterfaces(new Class[] { businessInterface });
SimpleInterface javassistProxy = (SimpleInterface) factory.create(null, null);
ClassLoader loader = Thread.currentThread().getContextClassLoader();
SimpleInterface proxy = EndpointProxy.newProxyInstance(loader, session, businessInterface, endpoint);