12.2.2 Using the library JAR class with a declared annotation

The classes included in the library JAR are used from each component. The annotations supported in the components that use these classes can be coded in the library JAR class.

The constraints on the annotations specifiable in the library JAR are as follows:

The following figure shows an example of usage of the classes coding the annotations in the library JAR.

Figure 12-1 Example of usage of the classes coding the annotations in the library JAR

[Figure]

When the annotation is referenced from EJB 3.0 or later or Servlet 2.5 or later, @Resource and @EJB included in the library JAR are enabled. When referenced from components of EJB 2.1 or earlier or Servlet 2.4 or earlier, @Resource and @EJB included in the library JAR are ignored. However, the J2EE application version at the reference source is presumed to be Java EE 5 or later.