package com.alibaba.mtc.threadpool.agent;


import java.lang.instrument.ClassFileTransformer;
import java.lang.instrument.Instrumentation;
import java.util.logging.Logger;


/**
 * @author ding.lid
 * @since 0.9.0
 */
public class MtContextAgent {
    private static final Logger logger = Logger.getLogger(MtContextAgent.class.getName());

    public static void premain(String agentArgs, Instrumentation inst) {
        logger.warning("[MtContextAgent.premain] begin, agentArgs: " + agentArgs);
        install(agentArgs, inst);
    }

    public static void agentmain(String agentArgs, Instrumentation inst) {
        logger.warning("[MtContextAgent.agentmain] begin, agentArgs: " + agentArgs);
        install(agentArgs, inst);
    }

    static void install(String agentArgs, Instrumentation inst) {
        logger.warning("[MtContextAgent] agentArgs: " + agentArgs + ", Instrumentation: " + inst);

        ClassFileTransformer transformer = new MtContextTransformer();
        inst.addTransformer(transformer, true);

        logger.warning("[MtContextAgent] addTransformer success.");
    }
}

@@ -836,16 +836,24 @@
 extAgent
+.install
 %5D agentA
@@ -1064,16 +1064,24 @@
 extAgent
+.install
 %5D addTra

improve log