[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [aspectj-dev] Using reflection to access join point...
|
Thanks Eric,
what still puzzles me is what do I pass to around advice as parameter?
Here is a simplified code snippet from my aspect.
Object around( ??? ) : cachedOperations() {
Object[] arguments = thisJoinPoint.getArgs();
Object result = proceed(arguments);
return result;
}
What to put insted of (???) or how to
define pointcut to be independent of the method signature ?
I have methods which are advised by this aspect that can have arbitrary
number/type of method parameters, such as:
public List getContentListByType(int type_id);
public AcmsContent getContentByName(String name);
public List getSubcontentList(int parent_id, int type_id);
... etc ...
This is probably some trivial thing, but documentation wasn't really
helpful.
Nemanja.
Eric Bodden wrote:
Actually all you have to do is invoke thisJoinPoint.getArgs(), which returns
an array of objects which were passed as arguments. Its as simple as that.
You may want to have a look at the documentation of thisJoinPoint.
Eric