Tag

Premain

0 views collected around this technical thread.

Code Ape Tech Column
Code Ape Tech Column
Oct 14, 2024 · Backend Development

Understanding Java Agent: Premain and Agentmain Modes with Instrumentation

This article explains the concept of Java Agent, compares it with AOP, and provides step‑by‑step implementations of both premain and agentmain modes, including Maven packaging, VM attachment, class transformation, redefinition, retransformation, and a Javassist example for method timing.

AgentmainBytecode ManipulationInstrumentation
0 likes · 17 min read
Understanding Java Agent: Premain and Agentmain Modes with Instrumentation
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Aug 7, 2024 · Backend Development

Understanding and Implementing JavaAgent for Runtime Instrumentation

This article explains the concept, architecture, and practical implementation of JavaAgent for Java runtime instrumentation, covering its role, premain method, ClassFileTransformer usage, bytecode manipulation with ASM or Javassist, and step‑by‑step guidance to build, package, and attach a JavaAgent for method execution time monitoring.

BytecodeClassFileTransformerInstrumentation
0 likes · 10 min read
Understanding and Implementing JavaAgent for Runtime Instrumentation