New Session Bean Wizard
See Also
This wizard creates a new session
bean in an EJB module project. You open the wizard by right-clicking the
project node or Enterprise Beans node for any EJB module project and choosing
New > Session Bean.
You set the following information in the wizard:
- EJB Name. Set the name of the session bean in the deployment descriptors
and is the basis for the session bean's class and interface names.
- Location. Select the source folder where you want to create the session
bean files.
- Package. Select an existing package or type the name of a new package.
- Session Type. Select one of the following:
- Stateless. The bean does not save state information during its
conversation with the user. These enterprise beans are useful for simple
interactions between client and application service, interactions that
are complete in a single method invocation.
An example is an enterprise bean that processes orders. Each order
can be processed by an invocation of one method, such as processOrder().
All the information needed for processing is contained in the method
parameters.
- Stateful. The bean saves state information during its conversation
with the user. These enterprise beans are useful for business processes
that require an interaction between client and application service that
lasts longer than a single method invocation and requires memory of the
state of the interaction.
An example is an online shopping cart. The end user, through the client
program, can order a number of items. The stateful session bean managing
the interaction must accumulate items until the end user is ready to
review the accumulated order, approve or reject items, and initiate
processing of the lot. The stateful session bean has to store the unprocessed
items and enable the end user to add more.
- Create Interface. Specify which interfaces to create for the session
bean:
- Remote. Allow your session bean to be accessed from remote clients
using remote method calls. This usually means clients that are not running
on the session bean's application server.
- Local. Allow your session bean to be accessed from clients that
are running in the same Java virtual machine.
- See Also
- About Session Beans
- Creating an EJB Module Project
- Creating an Enterprise Bean
- Defining a Business Method
Legal Notices