|
|
EJB Samples Overview
This topic includes the following sections:
EJB Sample Applications Provided with WebLogic Enterprise
WebLogic Enterprise provides the following sample applications:
Shows a stateless session bean in which the client application must maintain any state across invocations to that bean.
Shows a session bean that uses stateful persistence.
Shows an entity bean that automatically generates its primary key by calling directly to a database using a connection pool and JDBC.
Shows an entity bean that automatically generates its primary key by calling directly to a database using a connection pool and an Oracle database.
Shows a stateless session bean called ParentBean that is the parent class for another bean, ChildBean.
Shows a stateless session bean called ChildBean that inherits methods from a ParentBean, and also shows one bean calling another bean.
Contains a Java application that creates a list of all the EJBs deployed in a WebLogic Enterprise server process.
This document describes each of these sample applications, and also explains how to build and run them.
EJB Samples Javadoc
Javadoc for the EJB sample applications is installed in the locations shown in Table 1-1. If you are viewing this document in a browser, you can click the name in the left column to display the related Javadoc.
Table 1-1 EJB Sample Application Javadoc
Sample Application |
Location |
---|---|
Windows NT %TUXDIR%\samples\j2ee\ejb\docs\index.html UNIX $TUXDIR/samples/j2ee/ejb/docs/index.html |
|
Windows NT %TUXDIR%\samples\j2ee\ejb\docs\samples\j2ee\ejb\basic\ UNIX $TUXDIR/samples/j2ee/ejb/docs/samples/j2ee/ejb/basic\ |
|
Windows NT %TUXDIR%\samples\j2ee\ejb\docs\samples\j2ee\ejb\basic\ UNIX $TUXDIR/samples/j2ee/ejb/docs/samples/j2ee/ejb/basic\ |
|
Windows NT %TUXDIR%\samples\j2ee\ejb\docs\samples\j2ee\ejb\sequence\ UNIX $TUXDIR/samples/j2ee/ejb/docs/samples/j2ee/ejb/sequence\ |
|
Windows NT %TUXDIR%\samples\j2ee\ejb\docs\samples\j2ee\ejb\sequence\ UNIX $TUXDIR/samples/j2ee/ejb/docs/samples/j2ee/ejbs/equence\ |
|
Windows NT %TUXDIR%\samples\j2ee\ejb\docs\samples\j2ee\ejb\subclass\ UNIX $TUXDIR/samples/j2ee/ejb/docs/samples/j2ee/ejb/subclass\ |
|
Windows NT %TUXDIR%\samples\j2ee\ejb\docs\samples\j2ee\ejb\subclass\ UNIX $TUXDIR/samples/j2ee/ejb/docs/samples/j2ee/ejb/subclass\ |
Before you Build and Run the EJB Sample Applications
Each of the subsequent chapters in this guide explain all the steps for building and running each sample. In general, though, note the following about these sample applications:
Windows NT
%TUXDIR%\samples\j2ee\ejb
UNIX
$TUXDIR/samples/j2ee/ejb
Windows NT
%TUXDIR%\samples\j2ee\ejb
UNIX
$TUXDIR/samples/j2ee/ejb
You need to build each sample one at a time. All the samples use the following common build and execute a script, which are located in the preceding directory, for each platform:
Windows NT
Execute the batch file runme.cmd.
UNIX
Execute shell script file runme.ksh.
Variable |
Description |
---|---|
TUXDIR |
The directory path where you installed the WebLogic Enterprise software. For example: Windows NT TUXDIR=c:\wledir UNIX TUXDIR=/usr/local/wledir |
JAVA_HOME |
The directory path where you installed the JDK software. For example: Windows NT JAVA_HOME =c:\JDK1.2 UNIX JAVA_HOME =/usr/local/JDK1.2 |
ORACLE_HOME |
The directory path where you installed the Oracle software. For example: ORACLE_HOME=/usr/local/oracle You need to set this environment variable on UNIX operating systems only. |
Table 1-2 System Environment Variables
Variable |
Description |
---|---|
HOST |
The host name portion of the TCP/IP network address used by the ISL process to accept connections from Java clients. The default value is the name of the local machine. |
PORT |
The TCP port number at which the ISL process listens for incoming requests; it must be a number between 0 and 65535. The default value is 2468. |
IPCKEY |
The address of shared memory; it must be a number greater than 32769 unique to this application on this system. The default value is 55432. |
DB_INSTANCE |
Name of the database instance or server. The default value for Oracle is Beq-Local. This is needed only for the samples that use a database. |
DB_USER |
Name of the database user. The default is scott. This is needed only for the samples that use a database. |
DB_PASSWORD |
Password for the database user. The default is tiger. This is needed only for the samples that use a database. |
DB_DRIVER |
The Java class name of the database driver. The default is the Oracle 8i driver, weblogic.jdbc20.oci815.Driver.This is needed only for the samples that use a database. |
DB_URL |
Database connection URL. The default for Oracle is jdbc:weblogic:oracle:Beq-Local. If the database instance is not named, set DB_INSTANCE to null. This is needed only for the samples that use a database. |
When you enter the tmboot command to start one of the EJB sample applications, the following server processes are started:
The BEA Tuxedo system Event Broker.
The following TMFFNAME processes are started:
The TMFFNAME server process with the -N option and the -M option is the MASTER NameManager service. The -N option starts the NameManager service; the -M option starts this name manager as a MASTER. This service maintains a mapping of application-supplied names to object references.
The TMFFNAME server process with the -N option only is a SLAVE NameManager service.
The TMFFNAME server with the -F option contains the FactoryFinder object.
The JavaServer takes one or more EJB JAR files that were created for the application.
The IIOP Listener/Handler.
Restoring the Sample Applications Directory to Its Original State
You can restore the sample application directory to its original state by completing the following steps:
Windows NT
prompt>%TUXDIR%\samples\j2ee\ejb\clean.cmd
UNIX
prompt>./$TUXDIR/samples/j2ee/ejb/clean.ksh
|
Copyright © 2000 BEA Systems, Inc. All rights reserved.
|