background image

Getting Started with Enterprise Beans

<< More Information about Enterprise Beans | Coding the Enterprise Bean >>
<< More Information about Enterprise Beans | Coding the Enterprise Bean >>

Getting Started with Enterprise Beans

Getting Started with Enterprise Beans
This chapter shows how to develop, deploy, and run a simple Java EE application named
converter
. The purpose of converter is to calculate currency conversions between Japanese
yen and Eurodollars. converter consists of an enterprise bean, which performs the
calculations, and two types of clients: an application client and a web client.
Here's an overview of the steps you'll follow in this chapter:
1. Create the enterprise bean: ConverterBean.
2. Create the application client: ConverterClient.
3. Create the web client in converter-war.
4. Deploy converter onto the server.
5. Run the application client.
6. Using a browser, run the web client.
Before proceeding, make sure that you've done the following:
Read
Chapter 1, "Overview."
Become familiar with enterprise beans (see
Chapter 20, "Enterprise Beans"
).
Started the server (see
"Starting and Stopping the Application Server" on page 68
).
Creating the Enterprise Bean
The enterprise bean in our example is a stateless session bean called ConverterBean. The source
code for ConverterBean is in the
tut-install/javaeetutorial5/examples/ejb/converter/converter-ejb/src/java/
directory.
Creating ConverterBean requires these steps:
1. Coding the bean's business interface and class (the source code is provided)
2. Compiling the source code with the Ant tool
21
C H A P T E R
2 1
645