Information Technology Reference
In-Depth Information
Table 3.1.
The dynamic join points of AspectJ.
Kind of join point
Points in the program execution at which . . .
method call
A method (or a constructor of a class) is called.
constructor call
Call join points are in the calling object, or in
no object if the call is from a static method.
method call reception
An object receives a method or constructor call.
constructor call reception
Reception join points are before method or con-
structor dispatch, i. e. they happen inside the
called object, at a point in the control flow after
control has been transferred to the called
object, but before any particular method or
constructor has been called.
method execution
An individual method or constructor is invoked.
constructor execution
field get
A field of an object, class or interface is read.
field set
A field of an object or class is set.
exception handler execution
An exception handler is invoked.
class initialisation
Static initialisers for a class are run.
object initialisation
When the dynamic initialisers for a class are
run during object creation.
matches any call to either the setX or setY methods defined by Point that return
void and have a parameter of int . Pointcuts may also be declared by name, for
example:
pointcut weAreMoving():
call(void Point.setX(int)) ||
call(void Point.setY(int));
As well as pointcuts that match an explicit method call, as described above,
pointcuts may also contain wildcard characters that can match a number of dif-
ferent methods. Consider the following:
call (public String Figure.get∗(..))
call (public ∗ Figure.∗(..))
The first matches any call to public methods defined in Figure that start with
get , take any number of parameters, and return a String . The second matches
any call to a public method defined in Figure .
AspectJ defines the advice declaration to stipulate the code that is run at a
join point. Three types of advice are supported:
 
Search WWH ::




Custom Search