User Tools

Site Tools


basics:ex2

This is an old revision of the document!


The Basics: Exercise 2

Add another advice to the Basics aspect to print out a message immediately before the execution of all methods of Application whose name starts with the letters “st”.

Inside the pointcut, you can use the wildcard * to match any type or identifier (or any type or identifier with a certain beginning). As part of the argument list, you can use .. to match any number of arguments.

Since the advice applies to different methods, print the signature of the join point in the advice body using the following snippet:

System.out.println(thisJoinPoint.getSignature());
Inside an advice, the reserved variable thisJoinPoint provides access to runtime information about the join point. It is of type JoinPoint.
basics/ex2.1172239748.txt.gz · Last modified: 2007/02/23 15:09 by bdefrain