Intro Ex1 Ex2 Ex3 Ex4 Ex5 Ex6 Ex7
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”.
*
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:
output("ex2",thisJoinPoint.getSignature());
thisJoinPoint
provides access to runtime information about the join point. It is of type JoinPoint.
Rerun the application and verify that the aspect outputs a signature for methods start
and stop
.
Continue with Exercise 3.