background image

Writing the Application Components

<< HR Department Application | Coding the Message-Driven Beans >>
<< HR Department Application | Coding the Message-Driven Beans >>

Writing the Application Components

Writing the Application Components for the
clientmdbentity
Example
Writing the components of the application involves the following:
"Coding the Application Client: HumanResourceClient.java" on page 972
"Coding the Message-Driven Beans for the clientmdbentity Example" on page 973
"Coding the Entity Class for the clientmdbentity Example" on page 973
Coding the Application Client: HumanResourceClient.java
The application client program,
clientmdbentity-app-client/src/java/HumanResourceClient.java
, performs the
following steps:
1. Injects ConnectionFactory and Topic resources
2. Creates a TemporaryQueue to receive notification of processing that occurs, based on
new-hire events it has published
OfficeMDB
NewHire
Topic
ReplyQueue
Message Passing
HR
Client
SetupOffice
Entity
Method Invocation
M1
M1
M1
M2
M2
Finds
Creates and
Persists
Java EE Server
EquipmentMDB
FIGURE 32­2
A Java EE Application: Client to Message-Driven Beans to Entity
A Java EE Application That Uses the JMS API with an Entity
The Java EE 5 Tutorial · September 2007
972