Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Re: Verbose mode on ajc / aspectj compiler output?

Thanks Andy,  I did not attach the code beyond the pointcuts  due to the pointcuts not working correctly.  I assumed there were a glaring problem in the pointcuts that anyone beyond a novice (like myself) would just catch at a glance.

But apparently the pointcuts not working are due to my toolchain (?) instead of the code being incorrect. 

I am using the AspectJ weaver inside intellij 9.0.2   We have other Aspects that are working correctly. This is a bit strange.

In any case I have downloaded Eclipse and will install the ADJT and  for eclipse and  PointcutDoctor tools. 

thx again.

2010/7/14 Andy Clement <andrew.clement@xxxxxxxxx>
Your code works for me.  Here it is in a more complete example:

@Aspect
class Azpect {

       @Pointcut(value = "execution(public * *.getManagedClass())")
       public void notInMethods() {
       }

       @Around(value = "!notInMethods() && execution(public * *.get* (..))
&& this(dao)", argNames = "thisJoinPoint, dao")
       public void foo(JoinPoint jp, Object dao) {

       }
}

class Foo {
       public void getManagedClass() {
       }

       public void getOne() {
       }

       public void getTwo() {
       }
}

Both getOne() and getTwo() are advised, but not getManagedClass()

I know you are interested in tools for this problem (and pointcut
doctor is that tool) but to get better assistance on the mailing list
if you post complete programs you will likely get a faster response.

My advice would be to build up your pointcuts from tiny pieces that do
exactly what you are expecting.  Did you attach advice to
notInMethods() - does it match where you expect?

Andy

On 13 July 2010 21:58, Stephen Boesch <javadba@xxxxxxxxx> wrote:
> So here's an example: I have code below that does not work.  How can I found
> out what's wrong with it?
> The intention is to advise all   get*() methods in the dao class.  Well that
> part works alone, but when adding in the "notInMethods" pointcut, then
> nothing works.  So what tooling can tell me why nothing gets advised
> anymore?
> @Pointcut(value = "execution(public * *.getManagedClass())")
> public void notInMethods() {
> }
> @Around(value = "!notInMethods() && execution(public * *.get* (..)) &&
> this(dao)", argNames = "thisJoinPoint, dao")
>
> 2010/7/13 Stephen Boesch <javadba@xxxxxxxxx>
>>
>> The development process for aspectj is proving to be very cumbersome  /
>> slow for a non-adept.  I'd like clear understanding of the selection process
>> of pointcut's, to know what's going on and why my pointcut expressions are
>> not performing as expected.
>> What are options for tooling?
>> Also, should I move away from @AspectJ and use the traditional ajc
>> compiler to get more information and better support?
>
> _______________________________________________
> 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