I know Java supports proxies. I've been checking Javassist but not sure whether it can support the following trick:
public class Hello {
public void hi() {
System.out.println("hi");
}
}
Hello hello = new Hello();
Hello proxyHello = createProxy(hello);
proxyHello.hi(); // method will be intercepted by a predefined proxy
Is it possible to do something like that?
Aucun commentaire:
Enregistrer un commentaire