User Tools

Site Tools


auth:ex1

Differences

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

Link to this comparison view

Next revision
Previous revision
auth:ex1 [2007/02/26 16:52] – created bdefrainauth:ex1 [2021/02/05 13:47] (current) – external edit 127.0.0.1
Line 1: Line 1:
-====== Authentication: Tracing ======+[[auth:intro|Intro]] 
 +[[auth:ex1|Ex1]] 
 +[[auth:ex2|Ex2]] 
 +[[auth:ex3|Ex3]] 
 +[[auth:ex4|Ex4]]====== Authentication: Tracing ======
  
 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. 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.
Line 6: Line 10:
 The signature pattern used with an ''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. The signature pattern used with an ''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.
 </note> </note>
 +
 +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:
 +
 +<code aspectj>
 +support.Log.write("@Authenticated " + thisJoinPoint.getSignature());
 +</code>
 +
 +Run the Figure Editor and verify the appearance of the tracing messages.
 +
 +----
 +
 +Continue with [[auth:ex2|Exercise 2]].
auth/ex1.1172505156.txt.gz · Last modified: 2007/02/26 16:52 by bdefrain