org.codehaus.aspectwerkz.transform
Class AspectWerkzPreProcessor

java.lang.Object
  extended by org.codehaus.aspectwerkz.transform.AspectWerkzPreProcessor
All Implemented Interfaces:
ClassPreProcessor

public class AspectWerkzPreProcessor
extends Object
implements ClassPreProcessor

AspectWerkzPreProcessor is the entry point of the AspectWerkz layer 2.

It implements the ClassPreProcessor interface defined in layer 1.

Available options are:

Author:
Alexandre Vasseur , Jonas BonŽr

Nested Class Summary
static class AspectWerkzPreProcessor.Output
          Structure build when invoking tool weaving
 
Field Summary
static boolean DETAILS
           
static boolean GENJP
           
static boolean VERBOSE
           
 
Constructor Summary
AspectWerkzPreProcessor()
           
 
Method Summary
 Context _preProcess(String className, byte[] bytecode, ClassLoader loader)
          Weaving of the class
static void dumpAfter(String className, Context context)
          Dumps class after weaving.
static void dumpBefore(String className, Context context)
          Dumps class before weaving.
 void initialize()
          Initializes the transformer stack.
static void log(String msg)
          Logs a message.
 byte[] preProcess(String name, byte[] bytecode, ClassLoader loader)
          Transform bytecode according to the transformer stack Adapted for embedded modes, that will filter out framework classes See preProcessWithOutput for a tool entry point.
 AspectWerkzPreProcessor.Output preProcessWithOutput(String name, byte[] bytecode, ClassLoader loader)
          Weaving without filtering any class and returning a rich object with emitted joinpoints
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERBOSE

public static final boolean VERBOSE

DETAILS

public static final boolean DETAILS

GENJP

public static final boolean GENJP
Constructor Detail

AspectWerkzPreProcessor

public AspectWerkzPreProcessor()
Method Detail

initialize

public void initialize()
Initializes the transformer stack.

Specified by:
initialize in interface ClassPreProcessor

preProcess

public byte[] preProcess(String name,
                         byte[] bytecode,
                         ClassLoader loader)
Transform bytecode according to the transformer stack Adapted for embedded modes, that will filter out framework classes See preProcessWithOutput for a tool entry point.

Specified by:
preProcess in interface ClassPreProcessor
Parameters:
name - class name
bytecode - bytecode to transform
loader - classloader loading the class
Returns:
modified (or not) bytecode

_preProcess

public Context _preProcess(String className,
                           byte[] bytecode,
                           ClassLoader loader)
Weaving of the class

Parameters:
className -
bytecode -
loader -
Returns:
the weaving context, where getCurrentBytecode is the resulting bytecode

preProcessWithOutput

public AspectWerkzPreProcessor.Output preProcessWithOutput(String name,
                                                           byte[] bytecode,
                                                           ClassLoader loader)
Weaving without filtering any class and returning a rich object with emitted joinpoints

Parameters:
name -
bytecode -
loader -
Returns:

log

public static void log(String msg)
Logs a message.

Parameters:
msg - the message to log

dumpBefore

public static void dumpBefore(String className,
                              Context context)
Dumps class before weaving.

Parameters:
className -
context -

dumpAfter

public static void dumpAfter(String className,
                             Context context)
Dumps class after weaving.

Parameters:
className -
context -


Copyright © 2002-2005 Jonas Bonér, Alexandre Vasseur. All Rights Reserved.