1 17 package org.apache.geronimo.transformer; 18 19 import java.lang.instrument.Instrumentation ; 20 import java.lang.instrument.ClassFileTransformer ; 21 22 25 public class TransformerAgent { 26 27 private static final TransformerCollection transformerCollection = new TransformerCollection(); 28 29 public static void premain(String args, Instrumentation inst) { 30 inst.addTransformer(transformerCollection); 31 } 32 33 public static void addTransformer(ClassFileTransformer classFileTransformer) { 34 transformerCollection.addTransformer(classFileTransformer); 35 } 36 37 public static void removeTransformer(ClassFileTransformer classFileTransformer) { 38 transformerCollection.removeTransformer(classFileTransformer); 39 } 40 } 41 | Popular Tags |