Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] cflowbelow and capturing context

I thought I did try that, however I did again just to be certain

     [iajc] error at AuditorPointcutCaptures.java::0 incompatible
number of arguments to pointcut, expected 2 found 0

    It is interesting that I get a similar error

    [iajc] [error   0]: error at audit/AuditorPointcutCaptures.java::0
incompatible number of arguments to pointcut, expected 1 found 0

   when I try
   @Pointcut("execution(@RuleSet * *(..)) && @annotation(rs)")
   public void ruleset(RuleSet rs) {
   }

   But I cannot track that down either and this

   @Pointcut("execution(@Category * *(..)) &&
cflowbelow(computationOfHealth()) && @annotation(category)")
   public void category(Category category) {
   }

   works fine, so I am flummoxed.

-Bhaskar


On Fri, May 21, 2010 at 2:10 PM, Andy Clement <andrew.clement@xxxxxxxxx> wrote:
> I haven't tried out this code in a real testcase, but perhaps
> something like this:
>
> @Pointcut("execution(@RuleSet * *(..)) && cflowbelow(category(c)) &&
> @annotation(rs)")
> public void ruleset(RuleSet rs, Category c) {
>
> Andy
>
> On 21 May 2010 13:56, Bhaskar Maddala <maddalab@xxxxxxxxx> wrote:
>> Hello,
>>
>>    I am trying to write a few point cuts and capture context and am
>> having trouble capturing the necessary context
>>
>>    Capture the execution pointcut for the Calculation.getHealth JP
>> method invocation
>>    @Pointcut("execution(public java.util.List<metrics.Health>
>> metrics.Calculation.getHealth(metrics.AggregateInfo))")
>>    public void computationOfHealth() {
>>    }
>>
>>    execution of any methods with the @Category annotation in the
>> cflowbelow computationOfHealth capture the annotation
>>    @Pointcut("execution(@Category * *(..)) &&
>> cflowbelow(computationOfHealth()) && @annotation(category)")
>>    public void category(Category category) {
>>    }
>>
>>   Require help here-
>>   execution of any methods with the @RuleSet annotation in the
>> cflowbelow category
>>   I would like to capture the ruleset (and if possible) the Category annotation
>>   @Pointcut("execution(@RuleSet * *(..)) &&
>> cflowbelow(category(Category)) && @annotation(rs)")
>>    public void ruleset(RuleSet rs) {
>>    }
>>
>>   I have tried a couple of different options
>>
>>   Not what I want but worth a shot
>>   @Pointcut("execution(@RuleSet * *(..)) && @annotation(rs)")
>>   and
>>   @Pointcut("execution(@RuleSet * *(..)) &&
>> cflowbelow(category(Category)) && @annotation(rs)")
>>    with the error message
>>     [iajc] MessageHolder:  (6 weaveinfo)  (530 info)  (1 error)
>>     [iajc] [error   0]: error at
>> audit/AuditorPointcutCaptures.java::0 incompatible number of arguments
>> to pointcut, expected 1 found 0
>>
>>     Assistance much appreciated.
>>
>> Thanks
>> Bhaskar
>> _______________________________________________
>> aspectj-users mailing list
>> aspectj-users@xxxxxxxxxxx
>> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>>
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>


Back to the top