new AgentBuilder.Default()
// 1. SET STRATEGY: Use REDEFINE to replace existing class definitions
.with(AgentBuilder.TypeStrategy.Default.REDEFINE)
.with(AgentBuilder.RedefinitionStrategy.RETRANSFORMATION)
// 2. POOL STRATEGY: Required for finding classes in isolated Child ClassLoaders
.with(AgentBuilder.PoolStrategy.Default.METADATA)
// 3. IGNORE CHECK: Ensure we aren't accidentally ignoring Citi/Comet packages
.ignore(ElementMatchers.none())
.type(typeDescription -> targetClassSet.contains(typeDescription.getName()))
.transform((builder, typeDescription, classLoader, module) -> {
System.out.println("PROFILER: Attempting transformation of " + typeDescription.getName());
return builder.method(ElementMatchers.any()
.and(ElementMatchers.not(ElementMatchers.isAbstract()))
.and(ElementMatchers.not(ElementMatchers.isNative())))
.intercept(Advice.to(comet.agent.ProfilerAgent.ProfilerAdvice.class));
})
.installOn(inst);
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (0)