When running in Jakarta EE, the container must extend the concepts defined in [concepts] with:
-
A Jakarta EE component is a bean if the lifecycle of its instances may be managed by the container according to the lifecycle context model defined in [contexts]
-
Contextual instances of a bean may be used in EL expressions that are evaluated in the same context
-
For some Jakarta EE components - like environment resources, defined in [resources] - the developer provides only the annotations and the bean implementation is provided by the container.
When running in Jakarta EE, the container must extend the capabilities defined in [capabilities], by providing:
-
scoped resolution by bean name when used in a Unified EL expression, as defined by [name_resolution].
As managed beans, EJB session beans may have multiple bean types depending on their client-visible types.
For instance, this session bean has only the local interfaces BookShop
and Auditable
, along with Object
, as bean types, since the bean class is not a client-visible type.
@Stateful
public class BookShopBean
extends Business
implements BookShop, Auditable {
...
}
The rules for determining the (unrestricted) set of bean types for Jakarta EE components are defined in [session_bean_types] and [resource_types].
Jakarta EE components such as servlets, EJBs and JavaBeans do not have a well-defined scope. These components are either:
-
singletons, such as EJB singleton session beans, whose state is shared between all clients,
-
stateless objects, such as servlets and stateless session beans, which do not contain client-visible state, or
-
objects that must be explicitly created and destroyed by their client, such as JavaBeans and stateful session beans, whose state is shared by explicit reference passing between clients.
CDI scopes add to Jakarta EE these missing well-defined lifecycle context as defined in [scopes].
When running in Jakarta EE, If the bean discovery mode is annotated
, the container must extend the rules defined in [default_bean_discovery] with:
-
bean classes of EJB sessions beans, are discovered, and
-
producer methods that are on an EJB session bean are discovered, and
-
producer fields that are on an EJB session bean are discovered, and
-
disposer methods that are on an EJB session bean are discovered, and
-
observer methods that are on an EJB session bean are discovered.
A bean with a name may be referred to by its name in Unified EL expressions.
There is no relationship between the bean name of an EJB session bean and the EJB name of the bean.
Bean names allow the direct use of beans in JSP or JSF pages, as defined in [el].
For example, a bean with the name products
could be used like this:
<h:outputText value="#{products.total}"/>
In the circumstances listed in [default_name], the rule for determining default name for an EJB session bean are defined in [session_bean_name].