01: /*
02: * Copyright 2001-2007 Geert Bevin <gbevin[remove] at uwyn dot com>
03: * Distributed under the terms of either:
04: * - the common development and distribution license (CDDL), v1.0; or
05: * - the GNU Lesser General Public License, v2.1 or later
06: * $Id: FinalTransformer.java 3811 2007-06-25 15:06:16Z gbevin $
07: */
08: package com.uwyn.rife.instrument;
09:
10: import com.uwyn.rife.tools.InstrumentationUtils;
11: import java.lang.instrument.IllegalClassFormatException;
12: import java.security.ProtectionDomain;
13:
14: /**
15: * This is a no-op transformer that is just used to output the instrumented
16: * bytecode of classes when the {@value com.uwyn.rife.tools.InstrumentationUtils#PROPERTY_RIFE_INSTRUMENTATION_DUMP}
17: * system property is set.
18: *
19: * @author Geert Bevin (gbevin[remove] at uwyn dot com)
20: * @version $Revision: 3811 $
21: * @since 1.6
22: */
23: public class FinalTransformer extends RifeTransformer {
24: protected byte[] transformRife(ClassLoader loader,
25: String className, Class<?> classBeingRedefined,
26: ProtectionDomain protectionDomain, byte[] classfileBuffer)
27: throws IllegalClassFormatException {
28: InstrumentationUtils.dumpClassBytes("adapted", className,
29: classfileBuffer);
30: return classfileBuffer;
31: }
32: }
|