• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Defining PointCuts in AspectJ AOP

 
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Guys,

I have a couple of public methods and I would like to exclude certain methods from being adviced. How can I specify the exclusion principle for my point cut on this class?
 
Joe San
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Got to get this done using !execution (* AbstractServiceClient.*(..))

But another question is how can I define this pointcut to apply for all classes under a specific package?
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Joe Harry wrote:Got to get this done using !execution (* AbstractServiceClient.*(..))

But another question is how can I define this pointcut to apply for all classes under a specific package?




!execution (* my.package.stuff.here.AbstractServiceClient.*(..))

Now that would only cover the class in my.package.stuff.here

You can also always combine execution() pointcuts together with &&(and), ||(or) or !

You could also create your own Annotation and annotate just the methods you want to advice with that annotation and use

execution(my.package.MyAnnoation * *(..))

By the way, why did you change your name to Joe Harry, when that isn't you real name? Or did you change your name?

Thanks

Mark
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic