Capturing annotations [message #590677] |
Wed, 26 October 2005 12:29 |
Benjamin Podszun Messages: 4 Registered: July 2009 |
Junior Member |
|
|
Hi there.
New to AspectJ I did some basic examples and now I want to use it to solve
real problems ;)
For my current work I planned to tag some methods with annotations to
provide security checks without implementing those several times. Is this
a good practice at all?
First tests work so far, but I'd like to use the information in my
annotation for the advice. Example:
@Guarded("AdminsOnly")
public void whatever() {}
I can match this join point using call(@Guarded * *(..)), but I see no way
to access the string value (or other values) later.
before() : call(@Guarded * *(..)) {
// I want to access the annotation here..
}
Using Google I always end up with the annotation-based way of using
AspectJ, the only usable info was http://ramnivas.com/blog/index.php?p=10
- but that's only a proposal and over a year old.
Can anyone lend me a helping hand here and tell me if it's a)
viable/okay/good practice to do what I plan to do here and b) how one is
supposed to access annotations of thisJoinPoint?
Thanks in advance,
Ben
|
|
|
Powered by
FUDForum. Page generated in 0.03718 seconds