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 Stateless Session Bean

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

For more information, see the following:

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

  1. Create the stateless session bean class.

    You can create a plain old Java object (POJO) and define it as a stateless session bean with the @Stateless annotation.

    Note:

    OC4J ignores the @Stateless attribute mappedName. For more information, see "OC4J Support for Annotation Attribute mappedName".
  2. Implement your business methods.

    Note:

    A stateless session bean does not need a remove method.
  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 stateless 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 stateless 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 stateless session bean class with the OC4J-proprietary oracle.j2ee.ejb.@StatelessDeployment 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").