Announcement Announcement Module
No announcement yet.
ControlFlowPointcut Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • ControlFlowPointcut

    I am trying to define a pointcut that is based both on the caller class and the target class. After reading the documentation I have the impression the ControlFlowPointcut is the solution for defining a pointcut on the caller class.
    Am I right?
    Does anybody have an example on how to extend the ControlFlowPointcut and declare the pointcut in the bean definitions?

    Can I link two pointcuts?: a RegexpPointcut and a ControlFlowPointcut .
    Any example would be helpful.


  • #2
    ControlFlowPointcut works by matching against the current call stack, so you can express that you want to match all joinpoints that are invoked from any method living in class Foo.

    You can link this with a RegexpPointcut using ComposablePointcut which allows you to bring together multiple pointcuts.

    Be aware that the cost of ControlFlowPointcut is quite high since it needs to parse a stack trace to find out the current flow. If you are using this approach in one of your main application paths consider using AspectJ with cflow() pointcuts which are much faster.