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






footer




 

 

 

 

 Home | About Us | Network | Services | Support | FAQ | Control Panel | Order Online | Sitemap | Contact

 

Our web partners: Inexpensive Web Hosting Java Web Hosting personal webspace webspace php  linux webhost

 html web templates DreamweaverQuality Web Templates PSD Web Templates

cheap webhost j2ee web Hosting buy webspace ftp webspace adult webspace

frontpage WebHosting webspace hosting cheap webhost

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

webhosting