Table of Contents

How to run a JAsCo AOP enabled application

There are three ways of running a JAsCo enabled application, either preprocess all beans to insert traps using the beanTransformer tool, or by employing the JAsCo HotSwap 1 or JAsCo HotSwap 2 implementations. The preprocess implementation has the advantage that it is highly portable and quite mature now. The JAsCo HotSwap 2 implementation requires a JVM 1.5+. Using the first generation HotSwap implementation is discouraged. When employing the JAsCo HotSwap 2, it is also possible to activate a third weaving approach, namely a real run-time weaver , inducing a huge performance gain.

Alternatives for running JAsCo:

1. By preprocessing the beans

Running a JAsCo enabled application is very easy, just run as you would do without jasco, jasco does not require a special script or virtual machine to run! Dont forget to prepocess your application classes by employing the transformBean tool.

Some Hints:

JAsCo options

The following options can be set when running a jasco application. Just pass them along with your VM, e.g. java -Djasco.debug=true test.Main2.

2. JAsCo HotSwap for AOSD (Deprecated)

The JAsCo HotSwap implementation allows to insert traps in only those methods that are subject of aspect application. When new aspects are added at run-time, all methods where the aspects are applicable upon, are hotswapped at run-time for a trapped version. Likewise, the orginal method is again installed when there is no aspect applicable any longer. As such, only those methods where aspects are applied upon are subject of a performance overhead!

Notice that HotSwap is complimentary with inserting traps by the beanTransformer pre-processer. If you’re certain that aspects are always applicable at specific classes, you can preprocess them beforehand, eliminating the HotSwap load-time overhead.

Drawbacks:

How to run a JAsCo HotSwap application: java <regular java options> jasco.HotSwap <main class> <arguments>

Examples:

JAsCo HotSwap options

All options available for running a JAsCo enabled application without HotSwap are also availabe with HotSwap. In addition, some other options are available for configuring hotswap:

The troubleshooting guide contains additional information about possible problems and issues with HotSwap.

Limitations of the current implementation (0.5.0)

3. JAsCo HotSwap 2 for AOSD

The JAsCo HotSwap implementation allows to insert traps in only those methods that are subject of aspect application. When new aspects are added at run-time, all methods where the aspects are applicable upon, are hotswapped at run-time for a trapped version. Likewise, the orginal method is again installed when there is no aspect applicable any longer. As such, only those methods where aspects are applied upon are subject of a performance overhead!

The second generation JAsCo HotSwap implementation employs the instrumentation framework available in Java 1.5. This solution is technically superior to the previous HotSwap implementation and is thus the preferred way to run a JAsCo application. Furthermore, HotSwap 2 supports unswap on method level and all regular java VM options!

Notice that HotSwap is complimentary with inserting traps by the beanTransformer pre-processer. If you’re certain that aspects are always applicable at specific classes, you can preprocess them beforehand, eliminating the HotSwap load-time overhead.

Requires:

How to run a JAsCo HotSwap 2 application: java -javaagent:<JAsCo installdir/jasco.jar> <regular java options including main class>

The jasco.jar file located in the root JAsCo installation directory has to be passed to the javaagent command switch!

Examples:

JAsCo HotSwap2 options

All options available for running a JAsCo enabled application without HotSwap are also availabe with HotSwap. In addition, some other options are available for configuring hotswap:

The troubleshooting guide contains additional information about possible problems and issues with HotSwap.

Limitations of the current implementation (0.6.0)

NONE!