package org.gcube.common.clients.stubs.jaxws.proxies; import java.lang.reflect.Proxy; public class GenericProxyFactory { @SuppressWarnings("unchecked") public static T getProxy(Class intf, final I obj) { return (T) Proxy.newProxyInstance(obj.getClass().getClassLoader(), new Class[] { intf }, new MethodRetriever(obj)); } }