Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Constructor join point



Fernando,

Firstly a small correction: your aspect advises constructor execution not
constructor calls. It will therefore advice any classes in your JAR that
have constructors not classes that call constructors. Secondly if you are
using AspectJ 1.2.1 try the new "-showWeaveInfo" option which will tell you
if/where advice is being woven.

Matthew Webster
AOSD Project
Java Technology Centre, MP146
IBM Hursley Park, Winchester,  SO21 2JN, England
Telephone: +44 196 2816139 (external) 246139 (internal)
Email: Matthew Webster/UK/IBM @ IBMGB, matthew_webster@xxxxxxxxxx
http://w3.hursley.ibm.com/~websterm/

Fernando Ferreira Campos <fernandofcampos@xxxxxxxxx>@eclipse.org on
10/11/2004 18:13:05

Please respond to aspectj-users@xxxxxxxxxxx

Sent by:    aspectj-users-admin@xxxxxxxxxxx


To:    aspectj-users@xxxxxxxxxxx
cc:
Subject:    [aspectj-users] Constructor join point


I have a aspect that traces constructors calls, like this:

public aspect ConstructorAspect{
    pointcut contructorExec() : execution(*.*.new(..)) &&
!within(ConstructorAspect);

    before() : contructorExec(){
        System.out.println( "Constructor executed" );
    }
}


When I weave it into a pre-compiled .jar file and run the application,
nothing is printed. What is wrong?

Regards,
Fernando.
_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/aspectj-users




Back to the top