Creating A Stateful Session Bean

  1. Select File > New > Other... from the Eclipse menu.

  2. Browse to EJB 3.0 > Session Bean and click the Next button.

  3. In the Create a new EJB 3 Session Bean dialog, enter the following:

    The Bean Package field: by.iba.ejb

    The Bean Name field: StatefulCalculator

    NOTE: make sure Stateful Session Bean Type radio button is selected.

    Click the Finish button.

    Stateful Session Bean - Finish

  4. The wizard has created two files: the Bean Implementation Class ( and the Bean [Business] Remote Interface (

    Bean Implementation Class and [Business] Remote Interface

    StatefulCalculatorBean class:

    package by.iba.ejb;
    import javax.ejb.Stateful;
    import by.iba.ejb.StatefulCalculator;
    public @Stateful class StatefulCalculatorBean implements StatefulCalculator {

    StatefulCalculator interface:

    package by.iba.ejb;
    import javax.ejb.Remote;
    public interface StatefulCalculator {

Professional hosting     Belorussian informational portal         Free SCWCD 1.4 Study Guide     Free SCDJWS 1.4 Study Guide     SCDJWS 1.4 Quiz     Free IBM Certified Associate Developer Study Guide     IBM Test 000-287. Enterprise Application Development with IBM WebSphere Studio, V5.0 Study Guide     Free Mock Exam Engine