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

  • Variable advice order

    Hi all,

    I've created an annotation/aspect combination to run some setup/tear down code around methods. I want it to run before and after @Transactional. I've marked my aspect class with @Order(Ordered.HIGHEST_PRECEDENCE) and it works ok, however it seems there should be a more flexible way. Is it possible to specify the order somewhere else, such as in the annotation itself? For example, what if in some cases I want to run advice A, B, and C in that order, but in other cases I want C, B, and A?

    thanks

    John

  • #2
    Hi
    >> it seems there should be a more flexible way
    Do you have a real use case for this? Since there is no support for this, it is probably not that common.
    A harsh way to change Advice order on a particular bean instance is to cast it to the Advised interface and use its methods.

    Comment

    Working...
    X