ProxyFactory factory = new ProxyFactory();
factory.setSuperclass(SessionFactoryImpl.class);
factory.setInterfaces(new Class[]{SessionFactory.class});
MethodHandler handler = new MethodHandler() {
@Override
public Object invoke(Object self, Method overridden, Method forwarder,
Object[] args) throws Throwable {
return overridden.invoke(currentInstance, args);
}