-
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
-
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.