my dog learned polymorphism*
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
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: 62
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: 17249
    
    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: 37970
    
  22
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
 
Similar Threads
Spring AOP and AspectJ Integration with EJB3
Generic problem
Not able to understant the error $Proxy7 cannot be cast
AspectJ LTW using Spring
Spring AOP: How can I create pointcut for middle argument ?