WebLogic Server 6.1.0a1 Code Examples, BEA Systems, Inc.

Package examples.ejb

The examples in this package illustrate different aspects of using Enterprise JavaBeans.

See:
          Description

Examples Summary
examples.ejb.basic.beanManaged An entity EJB with bean-managed JDBC persistence. The code in the EJB directly access the data storage. Client examples include a single client and servlet.
examples.ejb.basic.containerManaged An entity EJB with container-managed JDBC persistence. The code in the EJB never touches the data storage. Demonstrates using finder methods and the WebLogic is-modified-method-name extension to the EJB 1.1 Specification for optimizing calls to the underlying datastore.
examples.ejb.basic.statefulSession A stateful session EJB.
examples.ejb.basic.statelessSession A stateless session EJB.
examples.ejb.extensions.readMostly EJB demonstrating the user of read-mostly pattern. Demonstrates use of read-only and read-write entity EJBs.
examples.ejb.subclass A stateless session EJB that demonstrates inheritance in EJB code.
examples.ejb20.basic.beanManaged An entity EJB with bean-managed JDBC persistence written to the EJB 2.0 Specification.
examples.ejb20.basic.containerManaged An entity EJB with container-managed JDBC persistence written to the EJB 2.0 Specification.
examples.ejb20.basic.statefulSession A stateful session EJB written to the EJB 2.0 Specification.
examples.ejb20.basic.statelessSession A stateless session EJB written to the EJB 2.0 Specification.
examples.ejb20.homeMethods Demonstrates the use of home methods on an EJB.
examples.ejb20.message A message-driven EJB written to the EJB 2.0 specification.
examples.ejb20.relationships.one2many Demonstrates a one-to-many relationship between two EJBs.
examples.ejb20.relationships.many2many Demonstrates a many-to-many relationship between two EJBs.
 

Package ejb Description

These examples demonstrate different aspects of Enterprise JavaBeans. It is a good idea to run all of these examples before attempting to create your own Enterprise JavaBeans. They will show you the different steps involved.

Before Running the EJB 2.0 Examples

Before you can build and run the EJB 2.0 examples, you must first download the WebLogic Server 6.0 supplement, ejb20.jar, from the BEA product download page. This allows you to use the Enterprise JavaBeans features in the WebLogic Server 6.0 environment. Until you install the ejb20.jar file, you will be unable to build and run the EJB 2.0 examples.

Pre-Built Examples

The EJB 2.0 examples included in the WebLogic Server 6.0 distribution are not shipped pre-built. To run these examples, you must first download ejb20.jar and then build the example following the specific examples instructions.

Quick Guide to the EJB Examples

The following table lists all of the EJB examples by the feature demonstrated in the example. Note that this table includes EJB examples from other packages (cluster, wlec, jolt, etc.).

If you're interested in... ...then look at these examples:
Entity EJBs
The WebLogic entity bean extension isModified
Finders and finder expressions
Session EJBs
Calling an EJB from another EJB
EJB 2.0 relationships
Using inheritance in EJB code
Calling an EJB from a servlet
Using EJBs in WebLogic clusters
Calling a CORBA object on a Weblogic Enterprise Server from an EJB

Building and Running the Examples

  1. Read the instructions for each example, found at the links above.

  2. Set up your development environment as described in Setting your development environment.

  3. Depending on the example, set up any special properties, such as database persistence.

  4. Build each example, using the provided build scripts or makefile. We've provided instructions on using the build scripts.

    Certain examples build Jar files that contain multiple beans:

    Note that certain examples depend on other beans being built first:

  5. You can deploy each EJB by running the build script that places the EJB in /config/examples/applications in the WebLogic Server distribution, where it automatically deploys once the server is started. If you are already running the server and build another EJB, it is automatically placed in this directory and instantly deployed.

    If you build an example EJB with the supplied build scripts and deploy it, you can run the build script again and redeploy the bean from the same .jar.

  6. Refer to the specific instructions for each example to run that example.


Documentation is available at
http://e-docs.bea.com/wls/docs60/

Copyright © 2000 BEA Systems, Inc. All rights reserved.