On 02/06/2016 13:53, Andrew Dinn wrote:
:
Your #2 is good to explore. As I've mentioned in several other threads,
this is a possible way forward for some of the scenarios that have come
up in other threads. it may be that we have to improve support for
injecting new classes into existing modules. It's already possible with
low-level JVM TI/JNI of course, also possible in some cases with java
agents but not cases are possible yet without using Unsafe.
#2 is no good for Java agents which want to (re)transform an already
loaded class. That's not just an issue for dynamically loaded agents.
Even when the agent is loaded on the command line it may need to modify
a class which has already been loaded like, say, class Thread.
If we improve the ability to inject new classes into existing modules
then it will work for agents loaded into a running VM too.
-Alan