Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [aspectj-users] help on pointcuts weaving

Sorry for the tipo error : replace the line :

within(Package1..Package3) && call(.MyClass.method(..))

by

within(Package1..Package3) && call(public * MyClass.method(..))

 

 

Jean-Louis Pasturel

De : aspectj-users-bounces@xxxxxxxxxxx [mailto:aspectj-users-bounces@xxxxxxxxxxx] De la part de jeanlouis.pasturel@xxxxxxxxxxxxxxxxxx
Envoyé : mercredi 25 juin 2008 15:51
À : aspectj-users@xxxxxxxxxxx
Objet : RE: [aspectj-users] help on pointcuts weaving

 

To which package , does the class Socket belongs ?

 

When you write pointcuts for a method, you can write like :

call ( public * Package1.Package2.Package3.MyClass.method(..))

Or

within(Package1..Package3) && call(.MyClass.method(..))

 

The full Qualified Name of Class.method must be defined in your pointcut. How you wrote your pointcut, the weaver could not find certainly the class in the default package.

 

 

Jean-Louis Pasturel

De : aspectj-users-bounces@xxxxxxxxxxx [mailto:aspectj-users-bounces@xxxxxxxxxxx] De la part de Neeraja Maniyani
Envoyé : mercredi 25 juin 2008 15:38
À : aspectj-users@xxxxxxxxxxx
Objet : [aspectj-users] help on pointcuts weaving

 

hi,

 

The call in the java class looks like this

 

InetAddress testAddress = null;

Socket s = new Socket(addr, 80);

testAddress = s.getInetAddress().getLocalHost();

 

I want the advice to weave in at this "s.getInetAddress().getLocalHost(); " point.

 

The pointcut and advice with which i currently tested looks like this

 

pointcut name2()
  : call(public * Socket.getInetAddress(..)) && withincode(public * InetAddress.getLocalHost(..));
  
  
  before() : name2() {
   System.out.println("able to weave"); }

 

 

I have tested using this call(public * Socket.getInetAddress..*(..)).
 

But the advice dint get weaved in

 

thank you.

 

 

*********************************
This message and any attachments (the "message") are confidential and intended solely for the addressees.
Any unauthorised use or dissemination is prohibited.
Messages are susceptible to alteration.
France Telecom Group shall not be liable for the message if altered, changed or falsified.
If you are not the intended addressee of this message, please cancel it immediately and inform the sender.
********************************
*********************************
This message and any attachments (the "message") are confidential and intended solely for the addressees.
Any unauthorised use or dissemination is prohibited.
Messages are susceptible to alteration.
France Telecom Group shall not be liable for the message if altered, changed or falsified.
If you are not the intended addressee of this message, please cancel it immediately and inform the sender.
********************************

Back to the top