Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] [aj5] Javaagent reload ??

Alexandru Popescu wrote:

if you take a look at
http://java.sun.com/j2se/1.5.0/docs/api/java/lang/instrument/Instrumentation.html you'll notice redefineClasses(ClassDefinition[]) method that looks promising. Unfortunately as of Sun JDK 1.5.0 it cannot add, remove or change signature of methods nor modify inheritance, so it is not sufficient for the kind of class modifications AJ performs. Maybe in future releases...

afaik the instrumentation works only when classes are loaded for the first time.

What good would that method be when loading the class for the first time ;-)? BTW. the Eclipse built in debugger tries to use this method to hot swap code in the VM if you modify the sources of the program that is being debugged, but it fails more often than not due to the limitations mentioned above.

R.


Back to the top