User Tools

Site Tools


basics:ex2

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
basics:ex2 [2007/02/23 15:09] – created bdefrainbasics:ex2 [2021/02/05 13:49] (current) – external edit 127.0.0.1
Line 1: Line 1:
 +[[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 ====== ====== The Basics: Exercise 2 ======
  
Line 4: Line 12:
  
 <note tip> <note tip>
-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.+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.
 </note> </note>
  
Line 10: Line 18:
  
 <code aspectj> <code aspectj>
-System.out.println(thisJoinPoint.getSignature());+output("ex2",thisJoinPoint.getSignature());
 </code> </code>
  
Line 16: Line 24:
 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]]. 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]].
 </note> </note>
 +
 +Rerun the application and verify that the aspect outputs a signature for methods ''start'' and ''stop''.
 +
 +----
 +
 +Continue with [[basics:ex3|Exercise 3]].
basics/ex2.1172239748.txt.gz · Last modified: 2007/02/23 15:09 by bdefrain