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.
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.
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.
In the ex05_2
directory, build and deploy the
examples as you did for Exercise 5.1.
There are no new JBoss configuration files or components in this exercise.
Three example programs illustrate the concepts explained in the EJB book:
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 explanation of the code is not needed in this workbook.
Run Client_52a
, Client_52b
,
and Client_52c
by invoking the appropriate Ant
task as you did in previous examples:
run.client_52a
, run.client_52b
,
and run.client_52c
. Remember to set your
JBOSS_HOME
and PATH
environment
variables.