Announcement Announcement Module
Collapse
No announcement yet.
AutoProxy All Implementations of an Interface? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • AutoProxy All Implementations of an Interface?

    Is there a way to autoproxy all implementations of a specific interface in the applicationContext? If so, can I have my Advice only execute for specific methods? For example, whenever the save() method is called on my DAOs, I want to be able to time it. But, only the save() methods.

    Thanks.


    -sean z

  • #2
    You should be able to use an Advisor that has a method pointcut on that particular method. Pointcuts are used to filter which methods advice should apply to, and the autoproxy infrastructure uses this to determine which objects should wrapped in proxies.

    Comment


    • #3
      Rod,
      Are you referring to using NameMatchMethodPointcutAdvisor or StaticMethodMatcherPointcutAdvisor? If so, I believe the auto proxy facility will match on every object in the container that has a save() method, not just the one's implementing my DAO interface. Is this correct?


      -sean z

      Comment

      Working...
      X