Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-dev] pointcut problem

If you haven't already, see the FAQ entry on point
http://dev.eclipse.org/viewcvs/indextech.cgi/%7Echeckout%7E/aspectj-home/doc/faq.html#q:comparecallandexecution

Wes

Eric Macaulay wrote:
Hi,

Thanks it did work. I think the problem is that I'm still not completely
clear about the difference between execution and call. I know it's mentioned
in the documentation but if you were to go into more detail in future
editions it would be greatly appreciated.

Eric Macaulay

----- Original Message -----
From: Adrian Colyer <adrian_colyer@xxxxxxxxxx>
To: <aspectj-dev@xxxxxxxxxxx>
Sent: Wednesday, May 19, 2004 2:00 PM
Subject: Re: [aspectj-dev] pointcut problem



The *execution* of the ServerSocket constructor happens *within* the
ServerSocket class itself.

Try :

after() returning : within(Server) && call(ServerSocket.new(int)) { ...

instead, since the *call* to the constructor is indeed *within* the Server
class.

Regards, Adrian.

-- Adrian
Adrian_Colyer@xxxxxxxxxx



"Eric Macaulay" <eeoam@xxxxxxxxx>
Sent by: aspectj-dev-admin@xxxxxxxxxxx
19/05/2004 13:47
Please respond to
aspectj-dev


To
<aspectj-dev@xxxxxxxxxxx>
cc

Subject
[aspectj-dev] pointcut problem






I have the following constructor:

public Server() {
  try {
   socket = new ServerSocket(2004);
  }catch(IOException x) {
   System.out.println("Unable to create server socket.");
   System.exit(-1);
  }
 }

When the ServerSocket constructor returns I want to to print out a message
so I used this code:

after() returning(): within(Server) && execution(ServerSocket.new(int)) {
   System.out.println("listening...");
}

Howeve when I run the program no message is displayed. Can anyone help?

Eric Macaulay

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



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




Back to the top