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.3: The Local Component Interfaces

The example program in Exercise 5.3 explores the use of local interfaces. The Cabin entity bean you created in Exercise 4.1 will be expanded to provide a local interface for use in the TravelAgent stateless session bean. This exercise also describes how to modify your EJB deployment descriptors to enable local interfaces.

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.

Initialize the Database

The database should contain the 100 rows created by a successful execution of the test programs from Exercise 4.1.

Build and Deploy the Example Programs

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

Examine the JBoss-Specific Files

JBoss has a minor restriction. It requires that you use <ejb-link> when you want your bean to reference a local bean through an <ejb-local-ref> tag.

ejb-jar.xml

<ejb-jar> <enterprise-beans> ... <session> <ejb-name>TravelAgentEJB</ejb-name> <home>com.titan.travelagent.TravelAgentHomeRemote</home> <remote>com.titan.travelagent.TravelAgentRemote</remote> <ejb-class>com.titan.travelagent.TravelAgentBean</ejb-class> <session-type>Stateless</session-type> <transaction-type>Container</transaction-type> <ejb-local-ref> <ejb-ref-name>ejb/CabinHomeLocal</ejb-ref-name> <ejb-ref-type>Entity</ejb-ref-type> <local-home>com.titan.cabin.CabinHomeLocal</local-home> <local>com.titan.cabin.CabinLocal</local> ...
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