5.1.1. Basics of EJB context
As you can see in the following listing, the EJBContext interface allows direct program-
matic access to services such as transaction, security, and timers, which are typically speci-
fied through configuration and managed completely by the container.
Listing 5.1. javax.ejb.EJBContext interface
lysis for later, when we discuss the services that each of the methods is related to. For now,
you should note the array of services offered through the EJB context, as well as the meth-
Table 5.1. You can use javax.ejb.EJBContext to access runtime services
These methods are useful when using bean-managed security. We discuss these
two methods further in chapter 6 when we discuss programmatic security.
These methods are used to obtain the bean's “remote home” and “local home”
interfaces respectively. Both are optional for EJB 3 containers and are hardly
used beyond legacy EJB 2.1 beans. We won't discuss these methods beyond
this basic introduction. They're mainly provided for backward compatibility.
These methods are used for EJB transaction management in the case of
container-managed transactions. We discuss container-managed transactions in
greater detail in chapter 6 .