org.codehaus.aspectwerkz.transform
Class AspectWerkzPreProcessor

java.lang.Object
  extended byorg.codehaus.aspectwerkz.transform.AspectWerkzPreProcessor
All Implemented Interfaces:
ClassPreProcessor, RuntimeClassProcessor

public class AspectWerkzPreProcessor
extends Object
implements ClassPreProcessor, RuntimeClassProcessor

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

Field Summary
static boolean DETAILS
           
static boolean VERBOSE
           
 
Constructor Summary
AspectWerkzPreProcessor()
           
 
Method Summary
 byte[] _preProcess(String name, byte[] bytecode, ClassLoader loader)
           
static void dumpAfter(String className, Context context)
          Dumps class after weaving.
static void dumpBefore(String className, Context context)
          Dumps class before weaving.
static void dumpForce(Context context)
          Always dumps class.
 Collection getClassCacheTuples()
          Returns the caching tuples.
 void initialize(Hashtable params)
          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
 byte[] preProcessActivate(Class klazz)
          Runtime weaving of given Class according to the actual definition
 
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
Constructor Detail

AspectWerkzPreProcessor

public AspectWerkzPreProcessor()
Method Detail

initialize

public void initialize(Hashtable params)
Initializes the transformer stack.

Specified by:
initialize in interface ClassPreProcessor
Parameters:
params - not used

preProcess

public byte[] preProcess(String name,
                         byte[] bytecode,
                         ClassLoader loader)
Transform bytecode according to the transformer stack

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 byte[] _preProcess(String name,
                          byte[] bytecode,
                          ClassLoader loader)

preProcessActivate

public byte[] preProcessActivate(Class klazz)
                          throws Throwable
Runtime weaving of given Class according to the actual definition

Specified by:
preProcessActivate in interface RuntimeClassProcessor
Parameters:
klazz -
Returns:
new bytes for Class representation
Throws:
Throwable

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 -

dumpForce

public static void dumpForce(Context context)
Always dumps class.

Parameters:
context -

getClassCacheTuples

public Collection getClassCacheTuples()
Returns the caching tuples.

Returns:


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