[[basics:intro|Intro]]
[[basics:ex1|Ex1]]
[[basics:ex2|Ex2]]
[[basics:ex3|Ex3]]
[[basics:ex4|Ex4]]
[[basics:ex5|Ex5]]
[[basics:ex6|Ex6]]
[[basics:ex7|Ex7]]
====== 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 signature pattern, 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:
output("ex2",thisJoinPoint.getSignature());
Inside an advice, the reserved variable ''thisJoinPoint'' provides access to runtime information about the join point. It is of type [[http://www.eclipse.org/aspectj/doc/released/runtime-api/org/aspectj/lang/JoinPoint.html|JoinPoint]].
Rerun the application and verify that the aspect outputs a signature for methods ''start'' and ''stop''.
----
Continue with [[basics:ex3|Exercise 3]].