Java Reference
In-Depth Information
probably need are for resource references, interceptor binding, and declarative security. We
encourage you to explore these on your own.
Table 13.2. One-to-one mapping between annotations and XML descriptor elements
Corresponding descriptor
element
Annotation
Type
Annotation element
@Stateless
EJB type
<session-type>Stateless
name
ejb-name
@Stateful
EJB type
<session-type>Stateful
name
ejb-name
@MessageDriven
EJB type
message-driven
name
ejb-name
@Remote
Interface type
remote
@Local
Interface type
Local
Transaction management
type at bean level
@TransactionManagement
transaction-type
container-transaction trans-
attribute
@TransactionAttribute
Transaction settings method
interceptor-binding
interceptor-class
@Interceptors
Interceptors
@ExcludeClassInterceptors Interceptors
exclude-classinterceptor
@ExcludeDefaultInterceptors Interceptors
exclude-defaultinterceptors
@AroundInvoke
Custom interceptor
around-invoke
@PostActivate
Lifecycle method
post-activate
@PrePassivate
Lifecycle method
pre-passivate
@DeclareRoles
Security setting
security-role
@RolesAllowed
Security setting
method-permission
@PermitAll
Security setting
unchecked
@DenyAll
Security setting
exclude-list
@RunAs
Security setting
security-identity run-as
Resource references
(DataSource, JMS, environ-
ment, mail, and so on)
resource-ref resource-env-ref
message-destination-ref env-
ref
@Resource
Resource injection
Setter/field injection
injection-target
@EJB
EJB references
ejb-ref ejb-local-ref
@Persistence-Context
Persistence context reference
persistence-context-ref
@PersistenceUnit
Persistence unit reference
persistence-unit-ref
You can find the XML schema for the EJB 3 deployment descriptor at http://java.sun.com/
xml/ns/javaee/ejb-jar_3_0.xsd .
 
Search WWH ::




Custom Search