2.1.4 Scope of support for the annotations included in the javax.interceptor package

This subsection describes the applicability of annotations of the javax.interceptor package. The following sections describe the annotations that you can code in each component:

You can also use the javax.interceptor package annotations in a CDI application. However, take care when you use these annotations by combining with EJB. For details on the precautions to be taken, see 9. Using CDI with Application Server in the uCosminexus Application Server Common Container Functionality Guide.

Organization of this subsection
(1) WAR file (Servlet 3.0/Servlet 2.5 compliant)
(2) EJB-JAR file (EJB3.1/EJB3.0 compliant)
(3) Library JAR file (Servlets or JSPs)
(4) Library JAR file (Enterprise Bean, exception class, or other classes)

(1) WAR file (Servlet 3.0/Servlet 2.5 compliant)

No annotations can be used in a WAR file.

(2) EJB-JAR file (EJB3.1/EJB3.0 compliant)

The following table lists the annotations that you can code in an EJB-JAR file:

Table 2-16 Annotations (javax.interceptor package) that can be coded in an EJB-JAR file (EJB3.1/EJB3.0 compliant)

Annotation nameEnterprise BeanException classOther class
InterfaceSession BeanEntity BeanMessage-driven BeanInterceptor
Other than default InterceptorDefault Interceptor
@AroundInvoke--Y--NYY----
@ExcludeClassInterceptors--Y--N--------
@ExcludeDefaultInterceptors--Y--N--------
@Interceptors--Y--N--------
Legend:
Y: Supported.
N: Not supported by Application Server.
--: Not applicable.

(3) Library JAR file (Servlets or JSPs)

You cannot use the annotations in a servlet or JSP of a library JAR file.

(4) Library JAR file (Enterprise Bean, exception class, or other classes)

The following table lists the annotations that you can code in the Enterprise Beans, exception classes, or the other classes of a library JAR file:

Table 2-17 Annotations (javax.interceptor package) that can be use in a library JAR file (Enterprise Beans, exception classes, or other classes)

Annotation nameEnterprise BeanException class
InterfaceSession BeanEntity BeanMessage-driven BeanInterceptor
@AroundInvoke------NY--
Legend:
Y: Supported.
N: Not supported by Application Server.
--: Not applicable.