Intro Ex1 Ex2 Ex3 Ex4 Ex5 Ex6 Ex7
Create an aspect named Basics
with an auxiliary method output
:
public aspect Basics { public void output(String tag, Object o) { System.out.println(tag + ": " + o); } }
Next, add an advice to this aspect to prints a string just before the execution of the start()
method. Use the following form for your advice:
before(): <pointcut> { output("ex1","About to start"); }
execution(Signature)
. The signature pattern should at least specify the return type, the method name and the arguments.
Rerun the application to see the output from your aspect.
Continue with Exercise 2.