Skip Headers
Oracle® Containers for J2EE Enterprise JavaBeans Developer's Guide
10g (10.1.3.5.0)

Part Number E13981-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

Implementing an EJB 3.0 Stateful Session Bean

EJB 3.0 greatly simplifies the development of stateful session beans, removing many complex development tasks. For example:

For more information, see the following:

To implement an EJB 3.0 stateful session bean, do the following:

  1. Create the stateful session bean class.

    You can create a POJO and define it as a stateful session bean with the @Stateful annotation.

    Note:

    OC4J ignores the @Stateful attribute mappedName.
  2. Implement your business methods.

    To define a method of your stateful session bean class as a remove method, use the @Remove annotation.

  3. Optionally, define life cycle callback methods using the appropriate annotations.

    You do not need to define life cycle methods: OC4J provides an implementation for all such methods. Define a method of your stateful session bean class as a life cycle callback method only if you want to take some action of your own at a particular point in the stateful session bean's life cycle.

    For more information, see "Configuring a Life Cycle Callback Interceptor Method on an EJB 3.0 Session Bean".

  4. Optionally, define OC4J-proprietary deployment options.

    In an EJB 3.0 application, you can do this by annotating your stateful session bean class with the OC4J-proprietary oracle.j2ee.ejb.@StatefulDeployment annotation (see "Configuring OC4J-Proprietary Deployment Options on an EJB 3.0 Session Bean").

  5. Complete the configuration of your session bean (see "Using an EJB 3.0 Session Bean").