Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.codehaus.aspectwerkz.transform
Class AspectWerkzPreProcessor

    java.lang.Object
      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:

- `-Daspectwerkz.transform.verbose=yes` turns on verbose mode: print on stdout all non filtered class names and which transformation are applied
- `-Daspectwerkz.transform.dump=org.myapp.*` dumps transformed class matching pattern org.myapp.* (even unmodified ones) in ./_dump directory (relative to where applications starts). The syntax `-Daspectwerkz.transform.dump=*` matchs all classes. The pattern language is the same as pointcut pattern language.
- else `-Daspectwerkz.transform.dump=org.myapp.*,before` dumps class before and after the transformation whose name starts with org.myapp. (even unmodified ones) in ./_dump/before and ./_dump/after directories (relative to where application starts)
- `-Daspectwerkz.transform.filter=no` (or false) disables filtering of `org.codehaus.aspectwerkz` and related classes (trove, dom4j etc.). This should only be used in offline mode where weaving of those classes is needed. Setting this option in online mode will lead to `ClassCircularityError`.

Author:
  Alexandre Vasseur , Jonas Bonr

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` -

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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