wood burning stoves 2.0*
The moose likes Aspect Oriented Programming and the fly likes How to write the pointcut for a method in the inter-interface Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Aspect Oriented Programming
Bookmark "How to write the pointcut for a method in the inter-interface" Watch "How to write the pointcut for a method in the inter-interface" New topic
Author

How to write the pointcut for a method in the inter-interface

pkinuk Buler
Ranch Hand

Joined: May 22, 2009
Posts: 63
HI all,

I dont' know if 'Spring' is the correct group to ask my question. I'm new to the AspectJ. I have the following code:



I'm using the Aspecj annotation to declare the pointcut. The following is my code:


However, the method pointCutTest is never called when the method executeBatch is called in its implementation class. How can i set the pointcut for the method executeBatch in the implementation of PointCutIWantToSet?
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17250
    
    6

How about


"execution(* com.uk.foo.*.executeBatch(..))"

or simply

execution(* executeBatch(..))

unless there are executeBatch methods elsewhere.

I also think there could be an issue with a static inner class. Personally I avoid any inner classes anywhere in my code because it always just causes more issues/problems that it resolves.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38441
    
  23
pkinuk Buler wrote: . . . I dont' know if 'Spring' is the correct group to ask my question. . . .
AOP would be a better fit.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to write the pointcut for a method in the inter-interface