Java Reference
In-Depth Information
Methods
Description
This method is used for EJB transaction management in the case of bean-man-
aged transactions. We discuss bean-managed transactions in greater detail in
chapter 6 .
getUserTransaction
This method is used to get access to the EJB timer service. We discuss EJB
timers in chapter 7 .
getTimerService
This method is used to get references to objects stored in the JNDI registry.
With dependency injection, direct JNDI lookup has been rendered largely unne-
cessary. But there are some edge cases that dependency injection can't handle.
This method proves handy in such circumstances. We'll discuss this topic later
in this chapter.
lookup
This method allows the EJB to get access to context data from an interceptor.
We'll discuss interceptors in greater detail later in this chapter.
getContextData
5.1.2. EJB context interfaces
Both session and message-driven beans have their own subclasses of the javax.ejb
.EJBContext interface. As shown in figure 5.1 , the session bean-specific subclass
is javax.ejb.SessionContext ,
and
the
MDB-specific
subclass
is
javax.ejb.MessageDrivenContext .
Figure 5.1. EJBContext interface has a subclass for each session and message-driven bean type.
Each subclass is designed to suit the particular runtime environment of each bean type. As
a result, they either add methods to the superclass or invalidate methods not suited for the
bean type.
 
Search WWH ::




Custom Search