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.
No annotations can be used in a WAR file.
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 name | Enterprise Bean | Exception class | Other class | |||||
---|---|---|---|---|---|---|---|---|
Interface | Session Bean | Entity Bean | Message-driven Bean | Interceptor | ||||
Other than default Interceptor | Default Interceptor | |||||||
@AroundInvoke | -- | Y | -- | N | Y | Y | -- | -- |
@ExcludeClassInterceptors | -- | Y | -- | N | -- | -- | -- | -- |
@ExcludeDefaultInterceptors | -- | Y | -- | N | -- | -- | -- | -- |
@Interceptors | -- | Y | -- | N | -- | -- | -- | -- |
You cannot use the annotations in a servlet or JSP of a library JAR file.
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 name | Enterprise Bean | Exception class | ||||
---|---|---|---|---|---|---|
Interface | Session Bean | Entity Bean | Message-driven Bean | Interceptor | ||
@AroundInvoke | -- | -- | -- | N | Y | -- |