"I'm not back." - Bill Harding, Twister
Originally posted by Jim Yingst:
There wasn't any good way to do this until JDK 5 came out. See the java.lang.instrument package summary for an overview. The Instrumentation interface has a method getAllLoadedClasses() that should be just what you want.
[ March 25, 2008: Message edited by: Jim Yingst ]
"I'm not back." - Bill Harding, Twister
The mechanism used here may seem needlessly convoluted. It's designed so that these "agents" can really be separate programs - things like IDEs and debuggers, for example. If you just want to access an Instrumentation instance from within your program, it's a bit harder than necessary, but still possible.
"I'm not back." - Bill Harding, Twister
Steve Calkins wrote:I use Eclipse and the VM argument list was set to:
-javaagent:agent.jar
Don't get me started about those stupid light bulbs. |