Create a new aspect named AccessControl
. Define a pointcut named restricted()
that selects the execution of all methods or constructors that carry the @Authenticated
annotation.
execution
primitive pointcut can include an annotation to look for. You will need one execution
primitive pointcut with a method signature pattern and one with a constructor signature pattern.
As such, the aspect will have no influence on the program. Add an advice to output a tracing message before the execution of the join points selected by this pointcut. You can use the following log statement inside the advice body to write to the Console Panel of the editor:
support.Log.write("@Authenticated " + thisJoinPoint.getSignature());
Run the Figure Editor and verify the appearance of the tracing messages.
Continue with Exercise 2.