Results 1 to 2 of 2

Thread: Variable advice order

Hybrid View

  1. #1
    Join Date
    Nov 2007
    Posts
    12

    Default 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. #2
    Join Date
    Sep 2012
    Location
    Czech Republic
    Posts
    39

    Default

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •