138
Designing XML Based Applications
private Queue queue;
public SupplierOrderRcvr() throws RemoteException {
queueFactory = ...; // Lookup queue factory
queue = ...; // Lookup queue
...
}
public String receive(Source supplierOrder)
throws InvalidOrderException {
// Preprocess (validate and transform) the incoming document
String document = ...
// Extract the order id from the incoming document
String orderId = ...
// Forward the transformed document to the processing layer
// using JMS
QueueConnection connection
= queueFactory.createQueueConnection();
QueueSession session = connection.createQueueSession(...);
QueueSender queueSender = session.createSender(queue);
TextMessage message = session.createTextMessage();   
message.setText(document);
queueSender.send(message);
return orderId;
}
}
Code Example 4.4
Sending an XML Document to a JMS Queue
public class SupplierOrderMDB
implements MessageDrivenBean, MessageListener {
private OrderFulfillmentFacadeLocal poProcessor = null;
public SupplierOrderMDB() {}
public void ejbCreate() {
// Create a purchase order processor
poProcessor = ...
}






New Page 1








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

java web hosting

 

 

 Our partners: | PHP: Hypertext Preprocessor | Best Web Hosting | Java Web Hosting | Inexpensive Web Hosting |

Jsp Web Hosting | Cheapest Web Hosting | Jsp Hosting | Cheap Hosting

 

Virtualwebstudio. Business web hosting division of Web Design Plus. All rights reserved