I want to write a java annotation which times the method call. something like this:
@TimeIt
public int someMethod() { ... }
and when this m
I am surprised to see that no one pointed out java.lang.reflect.Proxy. Its an old thread, but I think this information would be helpful to someone.
Proxy has an interesting property which gives
You can have this proxy for all objects by making them implement some interface or you can use Comparable.
Look for section Dynamic proxies as decorator.
http://www.ibm.com/developerworks/library/j-jtp08305/