Annotated examples

This example uses JDK 5 annotations. To execute the ant file that comes with the example you need to be set up to use JDK 5, since the annotations will only compile with JDK 5 or above

Run with JDK 5

The two main targets for running with JDK 5 are

$ ant run.aopc.50
$ ant run.loadtime.50

ant.run.aopc.50

The ant.run.aopc.50 target uses compile-time weaving, and performs the following steps:

ant.loadtime.aopc.50

The ant.loadtime.aopc.50 target uses load-time weaving (the classes are transformed when first loaded) and performs the following steps:

Run with JDK 1.4

We might want to make use of annotations in our code, but still deploy to a JDK 1.4 environment. JBoss AOP ships with JBoss Retro which allows you to modify JDK 5 bytecode to run on JDK 1.4. To use annotations we still need to compile with JDK 5, the following two targets illustrate the steps to run annotated code on JDK 1.4:

$ ant run.aopc.14
$ ant run.loadtime.14

ant.run.aopc.14

The ant.run.aopc.14 target uses compile-time weaving, and performs the following steps:

ant.loadtime.14

The ant.loadtime.14 target uses loadtime-time weaving (the classes are:

transformed when first loaded) and performs the following steps: