@Target(TYPE) @Retention(RUNTIME) public @interface Entity { String name() default ""; EntityType entityType() default EntityType.CMP; AccessType access() default AccessType.PROPERTY; int version() default 3; }

Defines the transaction boundary for session business methods. The default value is REQUIRED. If @TransactionAttribute annotates the class, it defines the default value.

@Target({TYPE,METHOD}) @Retention(RUNTIME) public @interface TransactionAttribute { TransactionAttributeType value() default REQUIRED; }

Configures an EJB values for a field or method.

@EJB is essentially a @Resource where it's known that the result is an EJB interface.

In the following exaple, Resin will call setFoo method with the bean in "java:comp/env/ejb/foo" before the session is started.

@EJB void setFoo(example.Test test) { _test = test; } @Target({TYPE, METHOD, FIELD, PARAMETER}) @Retention(RUNTIME) public @interface EJB { String name() default ""; String businessInterface() default ""; String jndiName() default ""; }

Configures a JNDI values for a field or method.

Inject relies heavily on defaults from the field or method name and type. If more information is required, use @Resource, @EJB, or @EJBHome.

In the following exaple, Resin will call setDataSource method with the data source in "java:comp/env/jdbc/test" before the session is started.

@Inject(jndi-name="java:comp/env/jdbc/test") void setDataSource(javax.sql.DataSource dataSource) { _dataSource = dataSource; } @Target({METHOD, FIELD}) @Retention(RUNTIME) public @interface Inject { String jndiName() default ""; }

Configures a JNDI values for a field or method. @Resource is essentially the same as @Inject but provides more configurable options. @Resource can also be used at the Class level to declare a dependency in cases where the session bean loads the JNDI value by itself.

In the following exaple, Resin will call setDataSource method with the data source in "java:comp/env/jdbc/test" before the session is started. The "java:comp/env/jdbc" full name is inferred from the DataSource type.

@Resource(name="test") void setDataSource(javax.sql.DataSource dataSource) { _dataSource = dataSource; } @Target({TYPE, METHOD, FIELD, PARAMETER}) @Retention(RetentionPolicy.RUNTIME) public @interface Resource { String name() default ""; String resourceType() default ""; AuthenticationType authenticationType() CONTAINER; boolean shareable() default true; String jndiName() default ""; }
Copyright (c) 1998-2009 Caucho Technology, Inc. All rights reserved.
caucho® , resin® and quercus® are registered trademarks of Caucho Technology, Inc.