1 22 package org.jboss.aop.standalone; 23 24 import org.jboss.aop.AspectManager; 25 import org.jboss.aop.DynamicAOPStrategy; 26 import org.jboss.aop.HotSwapStrategy; 27 28 import java.lang.instrument.Instrumentation ; 29 30 36 public class Agent 37 { 38 39 public static void premain(String agentArgs, Instrumentation inst) 40 { 41 StandaloneClassPoolFactory factory = new StandaloneClassPoolFactory(); 42 AspectManager.setClassPoolFactory(factory); 43 AspectManager.instance(); 45 if (agentArgs != null && agentArgs.indexOf("-hotSwap") != -1) 46 { 47 DynamicAOPStrategy strategy = new HotSwapStrategy(new InstrumentationAdapter(inst)); 49 AspectManager.instance().setDynamicAOPStrategy(strategy); 50 AspectManager.setPrune(false); } 52 inst.addTransformer(new AOPTransformer()); 53 } 54 } | Popular Tags |