The J2EETM Tutorial
Home
TOC
PREV TOC NEXT Search
Feedback

Session Beans

by Dale Green

A session bean represents a single client inside the J2EE server. The client accesses remote services by invoking the session bean's methods. The session bean performs work for its client, shielding the client from complexity by executing business tasks inside the server.

As its name suggests, a session bean is similar to an interactive session. A session bean is not shared-it may have just one client, in the same way that an interactive session may have just one user. Like an interactive session, a session bean is not persistent. When the client terminates, its session bean appears to terminate and is no longer associated with the client.

Session beans are powerful because they extend the reach of your clients into remote servers-yet they're easy to build. The following section shows you how to construct a simple session bean.

A Session Bean Example
Session Bean Class
Helper Classes
State Management Modes
Stateful Session Beans
Stateless Session Beans
Choosing Between Stateful and Stateless Session Beans
The Life Cycle of a Session Bean
The Stateful Session Bean Life Cycle
The Stateless Session Bean Life Cycle
Other Enterprise Bean Features
Accessing Environment Entries
Comparing Enterprise Beans
Passing an Enterprise Bean's Object Reference
Home
TOC
PREV TOC NEXT Search
Feedback