Jonas Bonér bio photo

Jonas Bonér

Specialist at Large.
Public Speaker.
Powder Skier.
Obsessive Learner.
Jazz Addict.
Wannabee Musician.

Twitter LinkedIn Github
After two weeks of Ruthless Refactoring (TM) I can now announce that AspectWerkz version 0.6.3 has been released. I have among other things rewritten the whole definition and weave model implementation to support a much more powerful join point model. The join point model now have the essence of the AspectJ model.
    Here are some of the features/changes:
  • Completely new definition model. Aspects, advices, introductions and pointcuts are now completely orthogonal and the model now has the essence of the AspectJ model. See the documentation for details.
  • Abstract aspects definitions as well as pointcut expressions(e.g.((pc1 OR pc2) AND !pc3) and similar).
  • Multiple weave models.
  • Multiple AspectWerkz system can run in the same JVM concurrently.
  • setField and getField now works for get and set java.util.* collection fields (e.g. add/get/remove/size and so on).
  • Advice and introduction container is now pluggable. I.e. the user can provide its own custom implementation (f.e. to enable persistence).
  • The transparent persistence of advices and introductions have been moved to the sandbox.
  • Many bug fixes.
Here is an example of the new definition:
    <!-- ============================================= -->
    <!--  Define the advices                           -->
    <!-- ============================================= -->
    <advice-def name="log"

    <advice-def name="cache"

    <advice-def name="persistent"

    <advices-def name="log_and_cache">
        <advice-ref name="log"/>
        <advice-ref name="cache"/>

    <!-- ============================================= -->
    <!--  Define the introductions                     -->
    <!-- ============================================= -->
    <introduction-def name="serializable"

    <introduction-def name="mixin"

    <!-- ============================================= -->
    <!--  Define the abstract aspects                  -->
    <!-- ============================================= -->
    <abstract-aspect name="MyAbstractAspect">
        <advice pointcut="setters AND !getters">
            <advices-ref name="log_and_cache"/>

        <advice pointcut="persistentFields">
            <advice-ref name="persistent"/>

    <!-- ============================================= -->
    <!--  Define the aspects                           -->
    <!-- ============================================= -->
    <aspect name="MyAspect" extends="MyAbstractAspect">
        <introduction class="domain.*">
            <introduction-ref name="serializable"/>
            <introduction-ref name="mixin"/>

        <pointcut-def name="setters" type="method" pattern="String domain.*.set*(..)"/>
        <pointcut-def name="getters" type="method" pattern="String domain.*.get*(..)"/>
        <pointcut-def name="persistentFields" type="setField" pattern="* domain.*.*">
You can download the new release from the releases page