views:

644

answers:

1

Hi,

I have been able to define multiple aspects (one is @Before and another is @Around) using Spring AOP (combined with AspectJ annotations) over a business service class.

Currently they are getting called one by one (in sequence). However I would like to know how the priority of calling the aspects can be defined and where.

Please guide me with respect to Spring AOP. Please note that I am using Spring 2.5.3 framework.

Thanks in advance.

+2  A: 

I found the answer to this problem.

One can use @Order annotation to specify the order / sequence for particular Aspect class (the class annotated with @Aspect).

Or the aspect class can implement org.springframework.core.Ordered interface to provide order value to Spring framework.

jatanp