<document>
<localtoc/>

@EJB requests the injection of an EJB session bean.

@Target({TYPE, METHOD, FIELD}) public @interface EJB { String name() default ""; Class beanInterface() default Object.class; String beanName() default ""; String mappedName() default ""; }

@PersistenceContext requests the injection of a JPA PersistenceContext.

<example> @PersistenceContext(unitName="test") EntityManager _em; </example> package javax.persistence; @Target({TYPE, METHOD, FIELD}) public @interface PersistenceUnit { String name() default ""; String unitName() default ""; PersistenceContextType type() default TRANSACTION; PersistenceProperty[] properties() default {}; }

@PersistenceUnit requests the injection of a JPA PersistenceUnit.

<example> @PersistenceUnit(unitName="test") EntityManagerFactory _emf; </example> package javax.persistence; @Target({TYPE, METHOD, FIELD}) public @interface PersistenceUnit { String name() default ""; String unitName() default ""; }

javax.annotation.PostConstruct tells the assembler to call a method after the bean has been built, but before it is active.

package javax.annotation; @Target(value={PACKAGE,TYPE}) public @interface PostConstruct { }

javax.annotation.PreDestroy tells the container to call the annotated method before it is destroyed.

package javax.annotation; @Target(value={PACKAGE,TYPE}) public @interface PreDestroy { }

@Resource tells the assembler to retrieve a resource an assign it to a field or property. Typically, the resource will be stored in JNDI.

DataSource Configured by <database>
UserTransaction User XA interface provided by Resin
Executor JDK 1.5 thread pool interface (see java.util.concurrent)
package javax.annotation; @Target({TYPE, METHOD, FIELD}) @Retention(RetentionPolicy.RUNTIME) public @interface Resource { String name() default ""; Class<?> type() default Object.class; AuthenticationType authenticationType() default CONTAINER; boolean shareable() default true; String mappedName() default ""; String description() default ""; }
</document>