J2EE Servers - PowerPoint PPT Presentation

1 / 4
About This Presentation
Title:

J2EE Servers

Description:

The application client uses two connection factories--a preconfigured one and ... Closes the connection. MultiAppServerRequester.java ... – PowerPoint PPT presentation

Number of Views:32
Avg rating:3.0/5.0
Slides: 5
Provided by: michael114
Category:

less

Transcript and Presenter's Notes

Title: J2EE Servers


1
J2EE Servers
  • The administrator starts two J2EE servers.
  • On the local server, the administrator creates a
    connection factory to communicate with the remote
    server.
  • The application client uses two connection
    factories--a preconfigured one and the one just
    created--to create two connections, sessions,
    publishers, and subscribers. Each publisher
    publishes five messages.
  • The local and the remote message-driven beans
    each receive five messages and send replies.
  • The client's message listener consumes the
    replies.

2
Overall Structure
3
ReplyMsgBean.java
  • Casts the incoming message to a TextMessage and
    displays the text
  • Creates a connection, session, and publisher for
    the reply message
  • Publishes the message to the reply topic
  • Closes the connection

4
MultiAppServerRequester.java
  • It uses the JavaTM Naming and Directory
    InterfaceTM (JNDI) API naming context
    javacomp/env to look up two connection factories
    and a topic.
  • For each connection factory, it creates a
    connection, a publisher session, a publisher, a
    subscriber session, a subscriber, and a temporary
    topic for replies.
  • Each subscriber sets its message listener,
    ReplyListener, and starts the connection.
  • Each publisher publishes five messages and
    creates a list of the messages the listener
    should expect.
  • When each reply arrives, the message listener
    displays its contents and removes it from the
    list of expected messages.
  • When all the messages have arrived, the client
    exits.
Write a Comment
User Comments (0)
About PowerShow.com