Java Technology Home Page
A-Z Index

Java Developer Connection(SM)
Online Training

Downloads, APIs, Documentation
Java Developer Connection
Tutorials, Tech Articles, Training
Online Support
Community Discussion
News & Events from Everywhere
Products from Everywhere
How Java Technology is Used Worldwide
Print Button
 

Creating a Stateless Session Bean


by jGuru

[Help | API Docs | Short Course| Exercises]

This exercise implements an Inventory session bean, which can perform inventory operations using the MusicCD bean, with both beans operating in the middle-tier. Inventory-management operations are initiated by a distributed client, MusicInventoryClient.

Prerequisites

Skeleton Code

Tasks


  1. Design a wrapper class called MusicData, that can represent the persistent fields in MusicCD (namely upc, title, artist, type, price).

  2. Design an Inventory session bean that provides an addInventory() service. This argument should take an array of MusicData objects as an argument. Within the addInventory() method, this bean should establish a MusicCDHome reference and then loop through the data passed as an argument to addInventory(), creating MusicCD beans and setting their attributes.

  3. Compile all the classes that compose your bean.

  4. Package your session bean into a jar file, using the provided XML deployment descriptor.

Where help exists, the task numbers above are linked to the step-by-step help page.

Solution Source

The following files contain a complete implementation of the Inventory session bean:

Demonstration

There is no expected output for this exercise. The implementation of this session bean will be tested in a later exercise when this bean is deployed, and again in the final exercise where you will write a client that uses this bean.

Next Exercise

Exercises

Short Course

Copyright 1996-2000 jGuru.com. All Rights Reserved.


Print Button
[ This page was updated: 25-Apr-2000 ]
Products & APIs | Developer Connection | Docs & Training | Online Support
Community Discussion | Industry News | Solutions Marketplace | Case Studies
Glossary - Applets - Tutorial - Employment - Business & Licensing - Java Store - Java in the Real World
FAQ | Feedback | Map | A-Z Index
For more information on Java technology
and other software from Sun Microsystems, call:
(800) 786-7638
Outside the U.S. and Canada, dial your country's AT&T Direct Access Number first.
Sun Microsystems, Inc.
Copyright © 1995-2000 Sun Microsystems, Inc.
All Rights Reserved. Terms of Use. Privacy Policy.