[jboss-svn-commits] JBL Code SVN: r7960 - labs/jbossesb/trunk/product/samples/trailblazer2/client/src/org/jboss/soa/esb/samples/trailblazer/loanbroker
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Wed Nov 29 19:40:49 EST 2006
Author: daniel.brum at jboss.com
Date: 2006-11-29 19:40:43 -0500 (Wed, 29 Nov 2006)
New Revision: 7960
Modified:
labs/jbossesb/trunk/product/samples/trailblazer2/client/src/org/jboss/soa/esb/samples/trailblazer/loanbroker/LoanBroker.java
labs/jbossesb/trunk/product/samples/trailblazer2/client/src/org/jboss/soa/esb/samples/trailblazer/loanbroker/QuoteRequest.java
Log:
Modified: labs/jbossesb/trunk/product/samples/trailblazer2/client/src/org/jboss/soa/esb/samples/trailblazer/loanbroker/LoanBroker.java
===================================================================
--- labs/jbossesb/trunk/product/samples/trailblazer2/client/src/org/jboss/soa/esb/samples/trailblazer/loanbroker/LoanBroker.java 2006-11-30 00:06:01 UTC (rev 7959)
+++ labs/jbossesb/trunk/product/samples/trailblazer2/client/src/org/jboss/soa/esb/samples/trailblazer/loanbroker/LoanBroker.java 2006-11-30 00:40:43 UTC (rev 7960)
@@ -38,8 +38,6 @@
import org.jboss.soa.esb.samples.trailblazer.web.WebCustomer;
import org.jboss.soa.esb.services.registry.Registry;
import org.jboss.soa.esb.services.registry.RegistryFactory;
-import com.thoughtworks.xstream.XStream;
-import com.thoughtworks.xstream.io.xml.DomDriver;
/*
* LoanBroker is responsible for getting customer requests for loans onto the JBoss ESB
@@ -67,20 +65,6 @@
}
- private Customer getCustomer(WebCustomer wCustomer) {
- Customer customer = new Customer();
- customer.ssn = wCustomer.ssn;
- customer.name = wCustomer.name;
- customer.address = wCustomer.address;
- customer.email = wCustomer.email;
- customer.salary = wCustomer.salary;
- customer.loanAmount = wCustomer.loanAmount;
- customer.loanDuration = wCustomer.loanDuration;
- customer.creditScore = 0;
-
- return customer;
- }
-
public void processLoanRequest(WebCustomer wCustomer){
Customer customer = getCustomer(wCustomer);
@@ -100,6 +84,22 @@
}
+ private Customer getCustomer(WebCustomer wCustomer) {
+ Customer customer = new Customer();
+ customer.ssn = wCustomer.ssn;
+ customer.name = wCustomer.name;
+ customer.address = wCustomer.address;
+ customer.email = wCustomer.email;
+ customer.salary = wCustomer.salary;
+ customer.loanAmount = wCustomer.loanAmount;
+ customer.loanDuration = wCustomer.loanDuration;
+ customer.creditScore = 0;
+
+ return customer;
+ }
+
+
+ //uses plain JMS to send a text message
private void sendToJMSBank(Customer customer) {
try {
//create a Quote Request that the bank expects
@@ -109,18 +109,11 @@
quote.creditScore=customer.creditScore;
quote.creditHistoryLen=0; //not sure who added this one
quote.term=customer.loanDuration;
- quote.customerUniqueId=String.valueOf(customer.ssn); //cheat and use the ssn as the unique i.d for now
-
-
-// XStream xstream = new XStream(new DomDriver());
-// xstream.alias("org.jboss.soa.esb.samples.loanbroker.banks", QuoteRequest.class);
-// String quoteXML = xstream.toXML(QuoteRequest.class);
-
SendJMSMessage sender = new SendJMSMessage();
sender.setupConnection(
ModulePropertyManager.getPropertyManager(MODULE_NAME).getProperty(JMS_BANK_QUEUE));
- sender.sendAMessage(quote.getCSV());
+ sender.sendAMessage(quote.toString());
sender.stop();
}catch (Exception e) {
logger.error(e);
Modified: labs/jbossesb/trunk/product/samples/trailblazer2/client/src/org/jboss/soa/esb/samples/trailblazer/loanbroker/QuoteRequest.java
===================================================================
--- labs/jbossesb/trunk/product/samples/trailblazer2/client/src/org/jboss/soa/esb/samples/trailblazer/loanbroker/QuoteRequest.java 2006-11-30 00:06:01 UTC (rev 7959)
+++ labs/jbossesb/trunk/product/samples/trailblazer2/client/src/org/jboss/soa/esb/samples/trailblazer/loanbroker/QuoteRequest.java 2006-11-30 00:40:43 UTC (rev 7960)
@@ -33,6 +33,7 @@
public int amount;
public int term;
public String customerUniqueId;
+ public String customerEmail;
/**
* Gets for the credit score.
@@ -119,7 +120,7 @@
}
public String getCSV() {
- return (ssn+","+creditScore+","+creditHistoryLen+","+amount+","+term+","+customerUniqueId);
+ return (ssn+","+creditScore+","+creditHistoryLen+","+amount+","+term+","+customerUniqueId+","+customerEmail);
}
public String getCustomerUniqueId() {
More information about the jboss-svn-commits
mailing list