5-20 Programming Enterprise JavaBeans, Version 3.0, for Oracle WebLogic Server
5.4.8 Security-Related Annotations
The following metadata annotations are not specific to EJB 3.0, but rather, are general security-related annotations in the javax.annotation.security package.
5.4.9 Context Dependency Annotations
The following summarize the annotations used for context dependency. javax.ejb.PrePassivate
Designates a method to receive a callback before a stateful session bean is passivated. For more
information, see Section A.2.10,
javax.ejb.PrePassivate. javax.annotation.PostConstruct
Specifies the method that needs to be executed after dependency injection is done to perform
any initialization. For more information, see Section A.5.1, javax.annotation.PostConstruct.
javax.annotation.PreDestroy Specifies a method to be a callback notification to
signal that the instance is in the process of being removed by the container. For more information,
see Section A.5.2, javax.annotation.PreDestroy.
Table 5–8 Security-Related Annotations
Annotation Description
javax.annotation.security.DeclareRol es
Specifies the references to security roles in the bean class. For more information, see
Section A.6.1, javax.annotation.security.DeclareRoles.
javax.annotation.security.RolesAllow ed
Specifies the list of security roles that are allowed to invoke the beans business methods. For more
information, see Section A.6.4,
javax.annotation.security.RolesAllowed. javax.annotation.security.PermitAll
Specifies that all security roles are allowed to invoke the method. For more information, see
Section A.6.3, javax.annotation.security.PermitAll.
javax.annotation.security.DenyAll Specifies that no security roles are allowed to
invoke the method. For more information, see Section A.6.2,
javax.annotation.security.DenyAll. javax.annotation.security.RunAs
Specifies the security role which the method is run as. For more information, see
Section A.6.5, javax.annotation.security.RunAs.
Table 5–9 Context Dependency Annotations
Annotation Description
javax.ejb.EJB Specifies a dependency to an EJB business
interface or home interface. For more information, see
Section A.2.3, javax.ejb.EJB. javax.ejb.EJBs
Specifies one or more EJB annotations. For more information, see
Section A.2.4, javax.ejb.EJBs.
Table 5–7 Cont. Annotations to Specify Life Cycle Callbacks
Annotation Description
Programming the Annotated EJB 3.0 Class 5-21
5.4.10 Timeout and Exceptions Annotations