uCosminexus Application Server, EJB Container Functionality Guide

[Contents][Glossary][Index][Back][Next]

2.15.4 Execution order of the interceptors

The execution order of an interceptor is determined according to the following rules by default:

Note that the execution order of the default interceptor described here can be changed using the following method:

Points (1) to (4) describe these rules and the execution order combining the rules for overwriting annotations based on DD. For details on overwriting an annotation based on DD, see 12.6.2 Overwriting annotations based on DD in the uCosminexus Application Server Common Container Functionality Guide.

Organization of this subsection
(1) When the definition for controlling the invocation of the default interceptor and class level interceptor is specified
(2) When the definition for controlling the invocation of the default interceptor is specified
(3) When the definition for controlling the invocation of the class level interceptor is specified
(4) When the definition for controlling the invocation of the upper level interceptor is not specified

(1) When the definition for controlling the invocation of the default interceptor and class level interceptor is specified

The following table describes the execution order of the interceptors when the definition for controlling the invocation of the default interceptor and class level interceptor is specified. In this table, the execution order for combinations shown by Y/N in the column Use of <interceptor-order> for each item number is shown by numbers in front of the DD or annotation in the column Execution order of the interceptor.

Table 2-51 Execution order of the interceptors (when the definition for controlling the invocation of the default interceptor and class level interceptor is specified)

No. Use of <interceptor-order> Execution order of the interceptor
Default Class level Method level Default Class level Method level Interceptor method
1 Y Y Y -- -- 1. DD 2. Annotation
2 Y Y N -- -- 1. Annotation
2. DD
3. Annotation
3 Y N Y -- -- 1. DD 2. Annotation
4 Y N N -- -- 1. Annotation
2. DD
3. Annotation
5 N Y Y -- -- 1. DD 2. Annotation
6 N Y N -- -- 1. Annotation
2. DD
3. Annotation
7 N N Y -- -- 1. DD 2. Annotation
8 N N N -- -- 1. Annotation
2. DD
3. Annotation

Legend:
Default: Default interceptor
Class level: Class level interceptor
Method level: Method level interceptor
Interceptor method: Interceptor method specified in the Bean class
Y: Execution order is specified by using the <interceptor-order> tag.
N: Execution order is not specified by using the <interceptor-order> tag.
--: Not executed.
DD: The interceptor specified in the DD is executed.
Annotation: The interceptor specified in the annotation is executed.

(2) When the definition for controlling the invocation of the default interceptor is specified

The following table describes the execution order of the interceptors when the definition for controlling the invocation of the default interceptor is specified. In this table, the execution order for combinations shown by Y/N in the column Use of <interceptor-order> for each item number is shown by numbers in front of the DD or annotation in the column Execution order of the interceptor.

Table 2-52 Execution order of the interceptors (when the definition for controlling the invocation of the default interceptor is specified)

No. Use of <interceptor-order> Execution order of the interceptor
Default Class level Method level Default Class level Method level Interceptor method
1 Y Y Y -- -- 1. DD 2. Annotation
2 Y Y N -- 1. DD 2. Annotation
3. DD
4. Annotation
3 Y N Y -- -- 1. DD 2. Annotation
4 Y N N -- 1.Annotation
2. DD
3. Annotation
4. DD
5. Annotation
5 N Y Y -- -- 1. DD 2. Annotation
6 N Y N -- 1. DD 2. Annotation
3. DD
4. Annotation
7 N N Y -- -- 1.DD 2. Annotation
8 N N N -- 1. Annotation
2. DD
3. Annotation
4. DD
5. Annotation

Legend:
Default: Default interceptor
Class level: Class level interceptor
Method level: Method level interceptor
Interceptor method: Interceptor method specified in the Bean class
Y: Execution order is specified by using the <interceptor-order> tag.
N: Execution order is not specified by using the <interceptor-order> tag.
--: Not executed.
DD: The interceptor specified in the DD is executed.
Annotation: The interceptor specified in the annotation is executed.

(3) When the definition for controlling the invocation of the class level interceptor is specified

The following table describes the execution order of the interceptors when the definition for controlling the invocation of the class level interceptor is specified. In this table, the execution order for combinations shown by Y/N in the column Use of <interceptor-order> for each item number is shown by numbers in front of the DD or annotation in the column Execution order of the interceptor.

Table 2-53 Execution order of the interceptors (when the definition for controlling the invocation of the class level interceptor is specified)

No. Use of <interceptor-order> Execution order of the interceptor
Default Class level Method level Default Class level Method level Interceptor method
1 Y Y Y -- -- 1. DD 2. Annotation
2 Y Y N 1. DD -- 2. Annotation
3. DD
4. Annotation
3 Y N Y -- -- 1. DD 2. Annotation
4 Y N N 1. DD -- 2. Annotation
3. DD
4. Annotation
5 N Y Y -- -- 1. DD 2. Annotation
6 N Y N 1. DD -- 2. Annotation
3. DD
4. Annotation
7 N N Y -- -- 1. DD 2. Annotation
8 N N N 1. DD -- 2. Annotation
3. DD
4. Annotation

Legend:
Default: Default interceptor
Class level: Class level interceptor
Method level: Method level interceptor
Interceptor method: Interceptor method specified in the Bean class
Y: Execution order is specified by using the <interceptor-order> tag.
N: Execution order is not specified by using the <interceptor-order> tag.
--: Not executed.
DD: The interceptor specified in the DD is executed.
Annotation: The interceptor specified in the annotation is executed.

(4) When the definition for controlling the invocation of the upper level interceptor is not specified

The following table describes the execution order of the interceptors when the definition for controlling the invocation of the upper level interceptor is not specified. In this table, the execution order for combinations shown by Y/N in the column Use of <interceptor-order> for each item number is shown by numbers in front of the DD or annotation in the column Execution order of the interceptor.

Table 2-54 Execution order of the interceptors (when the definition for controlling the invocation of the upper level interceptor is not specified)

No. Use of <interceptor-order> Execution order of the interceptor
Default Class level Method level Default Class level Method level Interceptor method
1 Y Y Y -- -- 1. DD 2. Annotation
2 Y Y N -- 1. DD 2. Annotation
3. DD
4. Annotation
3 Y N Y -- -- 1. DD 2. Annotation
4 Y N N 1. DD 2. Annotation
3. DD
4.Annotation
5. DD
6. Annotation
5 N Y Y -- -- 1.DD 2. Annotation
6 N Y N -- 1. DD 2. Annotation
3. DD
4. Annotation
7 N N Y -- -- 1.DD 2. Annotation
8 N N N 1. DD 2. Annotation
3. DD
4. Annotation
5. DD
6. Annotation

Legend:
Default: Default interceptor
Class level: Class level interceptor
Method level: Method level interceptor
Interceptor method: Interceptor method specified in the Bean class
Y: Execution order is specified by using the <interceptor-order> tag.
N: Execution order is not specified by using the <interceptor-order> tag.
--: Not executed.
DD: The interceptor specified in the DD is executed.
Annotation: The interceptor specified in the annotation is executed.