code_junkie

AspectJ: parameter in a pointcut

Nov 12th, 2011
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. pointcut permissionCheckMethods(Session sess) :
  2. (execution(public * *(.., Session)) && args(*, sess));
  3.  
  4. public void delete(Object item, Session currentSession);
  5.  
  6. public List listAll(Session currentSession);
  7.  
  8. pointcut permissionCheckMethods(EhealthSession eheSess) :
  9. (execution(public * *(.., EhealthSession)) && args(*, eheSess))
  10. && !within(it.___.security.PermissionsCheck);
  11.  
  12. pointcut permissionCheckMethods2(EhealthSession eheSess) :
  13. (execution(public * *(EhealthSession)) && args(eheSess))
  14. && !within(it.___.security.PermissionsCheck)
  15. && !within(it.___.app.impl.EhealthApplicationImpl);
  16.  
  17. before(EhealthSession eheSess) throws AuthorizationException : permissionCheckMethods(eheSess)
  18. {
  19. Signature sig = thisJoinPointStaticPart.getSignature();
  20. check(eheSess, sig);
  21. }
  22.  
  23. before(EhealthSession eheSess) throws AuthorizationException : permissionCheckMethods2(eheSess)
  24. {
  25. Signature sig = thisJoinPointStaticPart.getSignature();
  26. check(eheSess, sig);
  27. }
  28.  
  29. pointcut permissionCheckMethods(Session sess) :
  30. (execution(public * *(..)) && args(.., sess));
Add Comment
Please, Sign In to add comment