📄 ioc-annotations.xtp
字号:
<document><header> <title>IoC Annotations</title> <version>Resin 3.1</version> <description><p>IoC annotations direct the assembler to perform injection orother lifecycle events..</p> </description></header><body><localtoc/><defun title="@EJB"><p>@EJB requests the injection of an EJB session bean.</p><def title="@EJB">@Target({TYPE, METHOD, FIELD})public @interface EJB { String name() default ""; Class beanInterface() default Object.class; String beanName() default ""; String mappedName() default "";}</def></defun><defun title="@PersistenceContext"><p>@PersistenceContext requests the injection of a JPA PersistenceContext.</p><example>@PersistenceContext(unitName="test")EntityManager _em;</example><def title="@PersistenceContext">package javax.persistence;@Target({TYPE, METHOD, FIELD})public @interface PersistenceUnit { String name() default ""; String unitName() default ""; PersistenceContextType type() default TRANSACTION; PersistenceProperty[] properties() default {};}</def></defun><defun title="@PersistenceUnit"><p>@PersistenceUnit requests the injection of a JPA PersistenceUnit.</p><example>@PersistenceUnit(unitName="test")EntityManagerFactory _emf;</example><def title="@PersistenceUnit">package javax.persistence;@Target({TYPE, METHOD, FIELD})public @interface PersistenceUnit { String name() default ""; String unitName() default "";}</def></defun><defun title="@PostConstruct"><p>javax.annotation.PostConstruct tells the assembler to call a methodafter the bean has been built, but before it is active.</p><def title="@PostConstruct">package javax.annotation;@Target(value={PACKAGE,TYPE})public @interface PostConstruct {}</def></defun><defun title="@PreDestroy"><p>javax.annotation.PreDestroy tells the container to call the annotatedmethod before it is destroyed.</p><def title="@PreDestroy">package javax.annotation;@Target(value={PACKAGE,TYPE})public @interface PreDestroy {}</def></defun><defun title="@Resource"><p>@Resource tells the assembler to retrieve a resource an assign itto a field or property. Typically, the resource will be stored in JNDI.</p><deftable title="Known types"><tr> <td>DataSource</td> <td>Configured by <<a href="env-tags.xtp#database">database</a>></td></tr><tr> <td>UserTransaction</td> <td>User XA interface provided by Resin</td></tr><tr> <td>Executor</td> <td>JDK 1.5 thread pool interface (see java.util.concurrent)</td></tr></deftable><def title="@Resource">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 "";}</def></defun></body></document>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -