From my understanding of Interceptor 1.1 spec from Oracle p.6
Multiple method interceptor methods are executed in this order:
2. interceptor class defined in @Interceptor() may have superclass. The interceptor methods in the super classes
3. the interceptors defined in @Interceptors().
4. class interceptor methods defined in the target class itself.
5. @AroundInvoke methods in target class's super classes
6. method level interceptors in target class
7. @AroundInvoke methods of the target class
1. interceptor's superclass.
2. Default interceptor
3. target class's superclass's @AroundInvoke methods
4. class interceptor bound by @Interceptor
5. method level interceptors bounded by @Interceptor
6. @AroundInvoke method on the target class.
From Frit's notes, the order is a little bit different.
Difference 1 : In the Oracle specification, the default interceptor is invoked first before the super classes of the interceptor defined in @Interceptor.
Difference 2: In the Oracle spec, step 3-5, it seems the interceptor defined in @Interceptor on the target class is invoked before the interceptor defined in the target class's super class.
But in step 3-4 of Frit's notes, it seems that the interceptor in the target's super class is invoked before the interceptor bound by @Interceptor on the target class itself.
On p. 6 of Interceptor 1.1 specification, it says
"If multiple method interceptor methods are defined for a target class, the following rules governing their invocation order apply. The deployment descriptor may be used to override the interceptor invocation order specified in annotations.
. default interceptor, if any, are invoked first...
. ... interceptor classes associated with the target class using the Interceptors annotation, the interceptor methods defied by those interceptor classes are invoked before any interceptor method defined on the target class.
. The around-invoke method defined on those interceptor classes are invoked in the same order as the specification of the interceptor classes in the Interceptors annotation....
From this quote, it does not say the order of interceptor method invocation must be default interceptor first , @Interceptor is the next, @AroundInvoke defined in those @Interceptor (....) is next and so on.
So, I think your notes is fine.
But this has to be in order:
After the interceptor methods defined on interceptor classes have been invoked, then in order: . any method-level interceptor for the target class
. around invoke methods of target class's super class
. around invoke method of the target class.
It presents a nice diagram in figure 5.4 saying default interceptors are invoked first, then class level interceptors and last method level interceptor although it is counter intuitive.
Also table 5.3 shows the differences between business method interceptors and lifecycle callback interceptors.