AspectWerkz is a dynamic, lightweight, high-performant AOP (Aspect-Oriented Programming) framework for Java. Created by Jonas Bonér and Alexandre Vasseur, it was originally hosted at Codehaus. In January 2005, the AspectJ and AspectWerkz projects merged, combining their efforts into a unified AOP platform for Java.
- High performance -- weaved code is entirely statically compiled, ranking 1st or 2nd in most AOP benchmarks
- Plain Java -- aspects, advices and introductions are written in plain old Java code; no new language to learn, no new compilation phases
- Annotation support -- matching on annotations (both JavaDoc and JSR-175), with user-defined annotations accessed through a single strongly typed API
- Flexible weaving -- bytecode modification at compile time, load time, and runtime; hooks in and transforms classes loaded by any class loader except the bootstrap class loader
- Rich join point model -- staticinitialization, method execution and call, constructor execution and call, field access, field modification, catch handlers, cflow, within and withincode, hasmethod and hasfield
- Rich semantics -- access runtime information about join points within advice using regular types without casting or object array access
- Introductions/Mixins -- add interfaces and implementations to existing classes (inter-type declarations)
- META-INF/aop.xml container -- deploy multiple
aop.xmlaspect definition files alongside deployed applications following the classloader hierarchy - Annotation definition -- define aspects and mixins using Java 5 annotations (JSR-175) or Java 1.3/1.4 custom doclets with strongly typed access
- XML definition -- define aspects and mixins using XML, which can also refine, override and resolve annotation definitions
- Pluggable aspect manager -- seamless integration with IoC frameworks like Spring or PicoContainer
- Multiple deployment models -- perJVM (singleton), perClass, perInstance for aspects; perInstance, perClass, perJVM for mixins
- Hot deployment -- aspects can be deployed and undeployed at runtime using a simple API
- Extensible container architecture -- run any aspects (AspectWerkz, Spring AOP, AOP Alliance, subset of AspectJ) within the AspectWerkz runtime
- New features in 2.x
- Implementation Issues
- General Definition Issues
- Annotation Definition
- XML Definition
- Annotation Driven Development
- Deployment
- Weaving
- Dynamic AOP
- Extensible Aspect Container
- IDE Integration
- FAQ
- Set
JAVA_HOMEto your Java installation. - Set
ASPECTWERKZ_HOMEto the root of the AspectWerkz distribution. - Add
ASPECTWERKZ_HOME/binto yourPATH. - Build the distribution:
ant dist - Run the tests:
ant test - Try an example:
ant samples:caching
For more details, see the Building documentation.
In January 2005, the AspectJ and AspectWerkz projects announced their merger. The combined effort brought together AspectJ's mature language extensions and compiler with AspectWerkz's dynamic weaving capabilities and annotation-driven approach. Many of the ideas pioneered in AspectWerkz -- such as load-time weaving, annotation-based aspect definition, and XML-based configuration -- were incorporated into AspectJ 5 and later versions.
The original website and documentation can be found on the Wayback Machine.
Apache License, Version 2.0. See LICENSE.txt for details.
- Jonas Bonér -- creator and developer
- Alexandre Vasseur -- developer