Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Annotation Pointcut

Hi

It looks as though there is a bug in the apsectj support in intellij. I used maven to weave aspect and the ajc compiler and in both cases the aspects were weaved correctly. 

Thanks

Amin

Sent from my iPhone

On 1 Sep 2010, at 16:17, Andy Clement <andrew.clement@xxxxxxxxx> wrote:

> I'm not sure what level of AspectJ you are using in IntelliJ.  There
> have been bugs in that area in the past but they are all addressed
> now.  have you tried compiling on the command line with a recent
> AspectJ to see if that behaves as you expect?
> 
> Andy
> 
> On 1 September 2010 07:05, Amin Mohammed-Coleman <aminmc@xxxxxxxxx> wrote:
>> Hi there.
>> 
>> Thanks for your reply. Can't believe I missed that! I've added the .. And it works to a certain extent. If my class doesn't extend IndexWriter then all the methods with the annotation get advised. When it extends the class no methods in the subclass get advised.
>> 
>> Obviously I'm missing something. Not sure what.
>> 
>> Thanks
>> Amin
>> 
>> Sent from my iPhone
>> 
>> On 1 Sep 2010, at 13:44, Matthew Adams <matthew@xxxxxxxxxxxxxxx> wrote:
>> 
>>> My guess is your method expression of "* *(*)", which means any method
>>> with any return type that takes exactly one parameter of any type".
>>> If you really mean any method, regardless of the number of arguments &
>>> types, then you'd want "* *(..)", which would make your pointcut:
>>> 
>>> @Pointcut("execution(@org.aminmc.remote.search.lucene.event.PublishEvent
>>> * *(..)) && @annotation(event)")
>>> 
>>> -matthew
>>> 
>>> On Tue, Aug 31, 2010 at 3:13 PM, Amin Mohammed-Coleman <aminmc@xxxxxxxxx> wrote:
>>>> Hi All
>>>> 
>>>> I am trying to match joinpoints that have the following annotation:
>>>> 
>>>> @PublishEvent
>>>> 
>>>> my pointcut definition looks like this:
>>>> 
>>>> @Pointcut("execution(@org.aminmc.remote.search.lucene.event.PublishEvent * *(*)) && @annotation(event)")
>>>> 
>>>> with the following advice:
>>>> 
>>>> @After("publishEvent(event)")
>>>>   public void handleEvent(final JoinPoint jp, final PublishEvent event) {
>>>>    ....
>>>>   }
>>>> 
>>>> The problem I am noticing is that I have a class that extends org.apache.lucene.index.IndexWriter and have overriden some of the methods and annotated them with @PublishEvent.  However the advice is not being applied. I am using IntelliJ. What I notice is that if I remove the extends keyword from the class then some of the methods get advised.  Not all methods get advised even though I have clearly marked the methods with @PublishEvent.
>>>> 
>>>> I would be grateful for any assistance on this.
>>>> 
>>>> Thanks
>>>> Amin
>>>> _______________________________________________
>>>> aspectj-users mailing list
>>>> aspectj-users@xxxxxxxxxxx
>>>> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>>>> 
>>> 
>>> 
>>> 
>>> --
>>> mailto:matthew@xxxxxxxxxxxxxxx
>>> skype:matthewadams12
>>> yahoo:matthewadams
>>> aol:matthewadams12
>>> google-talk:matthewadams12@xxxxxxxxx
>>> msn:matthew@xxxxxxxxxxxxxxx
>>> http://matthewadams.me
>>> http://www.linkedin.com/in/matthewadams
>>> _______________________________________________
>>> 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
>> 
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users


Back to the top