Starting Instrumentation Agent after VM Startup

Viewed 1114

I was hoping for someone to explain this item since I might be getting this wrong:

I was reading about Java Agent Instrumentation which says that the agent can start after VM startup. So if I want to dynamically replace some class (without brining down the app) is this what I am going to go for using agent-main? Or do I need to do something more here?

I know people might ask "Are you talking about JRebel" - not really because I want to do something simple and JRebel is an overkill.

instrument docs - Java docs for Instrumentation

I understand all the instrumentation overrides, but I am slightly confused how I can hook this agent with -agent argument after the app has started.

3 Answers
Related