Define the Glossary entity bean  Generate stubs and skeletons

Chapter 4: Creating Enterprise JavaBeans Components and Clients

Define the Query stateless session bean

As done to create the entity bean, we will define the session bean by first creating the bean interface and implementation classes in Java, then importing the classes into EAServer Manager.

StepsCreating the session bean classes

  1. Copy the following files from the html/docs/tutorial/ejb directory of your installation to the java/classes/Sample/Intro/Glossary directory:

  2. Compile these classes using a JDK 1.3 or later compiler, for example, on UNIX:

    cd $JAGUAR/java/classes/Sample/Intro/Glossary
    $JAGUAR/bin/jc Query*.java
    

    Or on Windows, in a Command window:

    cd %JAGUAR\java\classes\Sample\Intro\Glossary
    %JAGUAR%\bin\jc Query*.java
    

StepsImporting the classes into EAServer Manager

  1. In EAServer Manager, click on the Tutorial package.

  2. Select File | New Component.

  3. In the Component wizard, select Import From EJB Class File.

  4. In the Component wizard - CLASSPATH screen, click Next. No changes are required to the default CLASSPATH to import our classes.

  5. In the Component wizard - Import EJB Class Files screen, enter the values below:

    Field

    Value

    Component Name

    Query

    Component Type

    JaguarEJB::StatelessSessionBean

    Bean Class

    Sample.Intro.Glossary.QueryBean

    Specify Remote Interface

    (Checked)

    Home Interface Class

    Sample.Intro.Glossary.QueryHome

    Remote Interface Class

    Sample.Intro.Glossary.Query

    Specify Local Interfaces

    (Not checked)

  6. Click Finish. You see a dialog saying “All methods imported,” then the Component Properties dialog box displays.

  7. Apply or confirm the following settings to the General tab fields in the Component Properties dialog box:

    Field

    Value

    Description

    Tutorial EJB session bean

    Component Type

    EJB - Stateless SessionBean

    EJB Version

    2.0

    JNDI Name

    Tutorial/Query

    Leave other fields as-is, and click OK.





Copyright © 2005. Sybase Inc. All rights reserved. Generate stubs and skeletons

View this book as PDF