Skip to Main Content
Enterprise JavaBeans, Fourth Edition
book

Enterprise JavaBeans, Fourth Edition

by Sacha Labourey, Bill Burke, Richard Monson-Haefel
June 2004
Intermediate to advanced content levelIntermediate to advanced
792 pages
23h 17m
English
O'Reilly Media, Inc.
Content preview from Enterprise JavaBeans, Fourth Edition

Exercise 5.2: The EJBObject, Handle, and Primary Key

The example programs in Exercise 5.2 explore the APIs available through the EJBObject and EJBMetaData interfaces. They also reveal how to use Handle and HomeHandle as persistent references to EJB objects and homes.

Start Up JBoss

If you already have JBoss running, there is no reason to restart it. Otherwise, start it up as instructed in the JBoss Installation and Configuration chapter at the beginning of this workbook.

Initialize the Database

The database should contain the 100 rows created by a successful execution of the test programs from Exercise 4.1; otherwise, this example will not work properly.

Build and Deploy the Example Programs

In the ex05_2 directory, build and deploy the examples as you did for Exercise 5.1.

Examine the JBoss-Specific Files

There are no new JBoss configuration files or components in this exercise.

Examine and Run the Client Applications

Three example programs illustrate the concepts explained in the EJB book:

Client_52a.java

Shows the use of EJBObject to retrieve an EJB’s home interface.

Client _52b.java

Shows how to use isIdentical( ) to determine whether two EJB references are to the same object.

Client _52c.java

Shows how to use EJB handles as persistent bean references.

The example code is pulled directly from the EJB book and embellished somewhat to expand on introduced concepts. The EJB book does a pretty good job of explaining the concepts illustrated in the example programs, so further ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Enterprise JavaBeans, Third Edition

Enterprise JavaBeans, Third Edition

Richard Monson-Haefel
Enterprise JavaBeans 3.1, 6th Edition

Enterprise JavaBeans 3.1, 6th Edition

Andrew Lee Rubinger, Bill Burke
Enterprise JavaBeans 3.0, 5th Edition

Enterprise JavaBeans 3.0, 5th Edition

Richard Monson-Haefel, Bill Burke

Publisher Resources

ISBN: 059600530XSupplemental ContentCatalog PageErrata