Chapter 3 Service Endpoint Design
97
In Figure 3.8, the vertical lines represent the passage of time, from top to
bottom. The vertical rectangular boxes indicate when the entity (client or service) is
busy processing the request or waiting for the other entity to complete processing.
The half arrow type indicates asynchronous communication and the dashed vertical
line indicates that the entity is free to work on other things while a request is being
processed.
public class ReservationRequestRcvr {
public ReservationRequestRcvr() throws RemoteException {....}
public String receiveRequest(Source reservationDetails) throws
RemoteException, InvalidRequestException{
/** Validate incoming XML document **/
String xmlDoc = getDocumentAsString(reservationDetails);
if(!validDocument(xmlDoc))
throw new InvalidRequestException(...);
/** Get a JMS Queue and delegate the incoming request **/
/** to the queue **/
QueueConnectionFactory queueFactory = 
serviceLocator.getQueueConnectionFactory(....);
Queue reservationRequestQueue = 
serviceLocator.getQueue(...);
QueueConnection connection =
queueFactory.createQueueConnection();
QueueSession session = connection.createQueueSession(false,
Session.AUTO_ACKNOWLEDGE);
QueueSender queueSender = session.createSender(queue);
TextMessage message = session.createTextMessage();
message.setText(xmlDoc);
queueSender.send(message);
/** Generate and return a correlation identifier **/
return generateCorrelationID();
}
}
Code Example 3.16
Implementing Travel Agency Service Interaction
<





New Page 1








Home : About Us : Network : Services : Support : FAQ : Control Panel : Order Online : Sitemap : Contact : Terms Of Service

 

Our web partners:  Jsp Web Hosting  Unlimited Web Hosting  Cheapest Web Hosting  Java Web Hosting  Web Templates  Best Web Templates  Web Design Templates  Interland Web Hosting  Cheap Web Hosting  Filemaker Web Hosting  Tomcat Web Hosting  Quality Web Hosting  Best Web Hosting  Mac Web Hosting

 
 

Virtualwebstudio. Business web hosting division of Vision Web Hosting Inc. All rights reserved

Web Hosting Apache