1
2
3
4
5
6
7
8
9
10
11 package org.mule.examples.loanbroker.esn;
12
13 import org.mule.examples.loanbroker.DefaultLoanBroker;
14 import org.mule.examples.loanbroker.LoanBrokerException;
15 import org.mule.examples.loanbroker.credit.CreditAgencyService;
16 import org.mule.examples.loanbroker.messages.CreditProfile;
17 import org.mule.examples.loanbroker.messages.CustomerQuoteRequest;
18 import org.mule.examples.loanbroker.messages.LoanBrokerQuoteRequest;
19
20
21
22
23
24 public class SynchronousLoanBroker extends DefaultLoanBroker
25 {
26
27
28
29 private CreditAgencyService creditAgency;
30
31 public Object getLoanQuote(CustomerQuoteRequest request) throws LoanBrokerException
32 {
33 super.getLoanQuote(request);
34 LoanBrokerQuoteRequest bqr = new LoanBrokerQuoteRequest();
35 bqr.setCustomerRequest(request);
36
37
38 CreditProfile cp = creditAgency.getCreditProfile(request.getCustomer());
39 bqr.setCreditProfile(cp);
40
41 return bqr;
42 }
43
44 public CreditAgencyService getCreditAgency()
45 {
46 return creditAgency;
47 }
48
49 public void setCreditAgency(CreditAgencyService creditAgency)
50 {
51 this.creditAgency = creditAgency;
52 }
53 }