Thanks for the help!

I didn't realize there was a method pattern AND a constructor pattern.  I'll
look more into the details, but I think that was the confirmation I needed.

Tyler

On Mon, Jul 14, 2008 at 4:56 PM, Andrew Eisenberg <[EMAIL PROTECTED]>
wrote:

> See comments below:
>
> > public aspect ThreadTest {
> >     pointcut all():execution(*.new(..)) && !within(ThreadTest) &&
> > !within(Holder) &&!within(com.vladium..*);
> >
> >     after(): all()
> >     {
> >          System.out.println("Success");
> >     }
> > }
> This aspect works as expected, I hope.  Remember that only classes in
> your project and in your inpath are woven (ie- java.lang.String is not
> woven unless it is on your inpath).
>
>
> > public aspect ThreadTest {
> >     pointcut all():execution(* *.*(..)) && !within(ThreadTest) &&
> > !within(Holder) &&!within(com.vladium..*);
> >
> >     after(): all()
> >     {
> >         System.out.println("Success");
> >         }
> >     }
> > }
>
> This is working as expected and will not pick out constructors.  What
> is happening here is that you are using the execution primitive
> pointcut with a method pattern.  Method patterns are different from
> constructor patterns, even though execution (and call) can use both.
>
> You may want to try this pointcut instead (warning haven't tried this out):
>     pointcut all(): (execution(* *.*(..)) || execution(*.*(..))) &&
> !within(ThreadTest) && !within(Holder) &&!within(com.vladium..*);
>
> The second execution uses a constructor pattern.  You can see this
> because it does not have a return clause.
>
> Here is a more precise description of what patterns look like:
>
> http://www.eclipse.org/aspectj/doc/released/progguide/semantics-pointcuts.html#pattern-summary
> Here is a more precise description of what patterns are applicable to
> which primitive pointcuts:
>
> http://www.eclipse.org/aspectj/doc/released/progguide/semantics-pointcuts.html#primitive-pointcuts
>
> hope this helps,
> --a
> > I just noticed this and actually am more interested in catching calls to
> > init(..) made by a Tomcat server, but general curiousity is getting the
> > better of me.  Also, the calls to init() are sometimes returning null
> > thisJoinPoint.getTarget() calls, so I figure a solution to the
> constructor
> > mystery may help me.
> >
> > If you have any ideas on the init() or new() calls, let me know.
> >
> > Thanks!
> > Tyler
> >
> > _______________________________________________
> > aspectj-users mailing list
> > [email protected]
> > https://dev.eclipse.org/mailman/listinfo/aspectj-users
> >
> >
>
_______________________________________________
aspectj-users mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/aspectj-users

Reply via email to