読者です 読者をやめる 読者になる 読者になる

Fight the Future

何かを始めたら、半分成功したのと同じ

How can I get a web application classloader in Java Agent's method agentmain()

java jvm

I implement Java Agent which transform classes of a web application running in an application server.

To do so, I need a web application classloader which load these classes.

I know Instrument#getAllLoadedClasses() method.

But this method returns Class array, so I retrieve the Class loaded by web application class loader by Class name etc.

I think this is not good code.

Is there another way to get a web application classloader in Java Agent?