Designing the Stateless Session Bean

Figure 5.2 shows the design of the SignOn component. The SignOn stateless session bean implements the SessionBean interface. It implements the methods setSessionContext(), ejbCreate(), ejbActivate(), ejbPassivate(), and ejbRemove() as defined in the javax.ejb.SessionBean interface. In addition, it implements the validateUser() method, which accepts the user's login name and password as parameters and returns true if they are valid.

Figure 5.2. SignOn stateless bean design.


We also provide remote interfaces to our stateless session bean. They include a remote home interface (SignOnHome) and a remote interface (SignOn). The SignOnHome home interface extends the javax.ejb.EJBHome interface and defines a single create() method. The SignOn remote interface extends the javax.ejb.EJBObject interface and defines the validateUser() method. As you learned on Day 2, “Understanding EJB Types and Interfaces,” EJB container tools generate the classes that correspond to the home and remote interfaces.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.149.27.72