Looking Under the Hood of the Stateful Session Bean

Figure 6.1 shows the interactions between the client, the EJB container, and the stateful session bean.

Figure 6.1. Under the hood of a stateful session bean.

The following steps describe the sequence of interactions in detail:

1.
At startup, the EJB container registers enterprise beans with the Java Naming and Directory Interface (JNDI) service.
2.
The client looks up the home interface of the installed enterprise bean via JNDI. For example, the remote home interface for the enrollment cart session bean can be located using the following code segment:
 Context initialContext = new InitialContext(); ...

Get Sams Teach Yourself EJB in 21 Days now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.