O'Reilly logo

The Java™ EE 5 Tutorial, Third Edition: For Sun Java System Application Server Platform Edition 9 by Kim Haase, Scott Fordin, Ian Evans, Debbie Carson, Jennifer Ball, Eric Jendrock

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 22. Session Bean Examples

Session beans provide a simple but powerful way to encapsulate business logic within an application. They can be accessed from remote Java clients, web service clients, and from components running in the same server.

In Chapter 21, you built a stateless session bean named ConverterBean. This chapter examines the source code of three more session beans:

  • CartBean: a stateful session bean that is accessed by a remote client

  • HelloServiceBean: a stateless session bean that implements a web service

  • TimerSessionBean: a stateless session bean that sets a timer

The cart Example

The cart session bean represents a shopping cart in an online bookstore. The bean’s client can add a book to the cart, remove a book, or retrieve the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required