Implementing a Session Bean

Now that you’ve seen how to declare the component and home interfaces for a session bean, the next step is to look at implementing the bean class itself. What’s important here is to understand the methods you’re required to implement, how the container manages the life cycle of a session bean, and how to access other EJBs and resources, such as a database, from a session bean’s methods.

The SessionBean Interface

All session beans must implement the SessionBean interface, which extends EnterpriseBean just like the EntityBean interface does. Remember that EnterpriseBean is simply a marker interface, so it doesn’t add any methods to the set that your session beans have to implement. The container uses the methods declared ...

Get Special Edition Using Enterprise JavaBeans™ 2.0 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.