|
|
@@ -21,7 +21,7 @@ for AspectJ-1.2. |
|
|
|
runtime and must be redistributed with any system built using AspectJ. |
|
|
|
This module has no external dependencies and produces a tiny ~30KB jar. |
|
|
|
|
|
|
|
image:overview.gif[image] |
|
|
|
image:images/overview.gif[image] |
|
|
|
|
|
|
|
The AspectJ compiler accepts both AspectJ bytecode and source code and |
|
|
|
produces pure Java bytecode as a result. Internally it has two stages. |
|
|
@@ -94,7 +94,7 @@ aspect A { |
|
|
|
|
|
|
|
When parsed, this program will produce the following tree. |
|
|
|
|
|
|
|
image:top-tree.gif[image] |
|
|
|
image:images/top-tree.gif[image] |
|
|
|
|
|
|
|
==== PointcutDeclaration processing |
|
|
|
|
|
|
@@ -105,7 +105,7 @@ Let's look more closely at the pointcut declaration: |
|
|
|
pointcut entries(Main o): execution(void doit()) && this(o); |
|
|
|
.... |
|
|
|
|
|
|
|
image:pointcut-dec.gif[image] |
|
|
|
image:images/pointcut-dec.gif[image] |
|
|
|
|
|
|
|
The pointcut declaration is implemented as a subtype of a method |
|
|
|
declaration. The actual pointcut is parsed by the weaver module. This |
|
|
@@ -131,7 +131,7 @@ postParse, the selector is filled in and several additional arguments |
|
|
|
are added for the special thisJoinPoint forms that could be used in the |
|
|
|
body. |
|
|
|
|
|
|
|
image:advice-dec.gif[image] |
|
|
|
image:images/advice-dec.gif[image] |
|
|
|
|
|
|
|
At this point the statements field which will hold the body of the |
|
|
|
advice is still null. This field is not filled in until the second stage |
|
|
@@ -142,7 +142,7 @@ prelude to generating the classfile. |
|
|
|
|
|
|
|
The main classes in this module are shown in the following diagram: |
|
|
|
|
|
|
|
image:ajdt-uml.gif[image] |
|
|
|
image:images/ajdt-uml.gif[image] |
|
|
|
|
|
|
|
=== Weaving back-end (weaver) |
|
|
|
|