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 | 2 | public class SynchronousLoanBroker extends DefaultLoanBroker |
25 | |
{ |
26 | |
|
27 | |
|
28 | |
|
29 | |
private CreditAgencyService creditAgency; |
30 | |
|
31 | |
public Object getLoanQuote(CustomerQuoteRequest request) throws LoanBrokerException |
32 | |
{ |
33 | 2002 | super.getLoanQuote(request); |
34 | 2002 | LoanBrokerQuoteRequest bqr = new LoanBrokerQuoteRequest(); |
35 | 2002 | bqr.setCustomerRequest(request); |
36 | |
|
37 | |
|
38 | 2002 | CreditProfile cp = creditAgency.getCreditProfile(request.getCustomer()); |
39 | 2002 | bqr.setCreditProfile(cp); |
40 | |
|
41 | 2002 | return bqr; |
42 | |
} |
43 | |
|
44 | |
public CreditAgencyService getCreditAgency() |
45 | |
{ |
46 | 0 | return creditAgency; |
47 | |
} |
48 | |
|
49 | |
public void setCreditAgency(CreditAgencyService creditAgency) |
50 | |
{ |
51 | 2 | this.creditAgency = creditAgency; |
52 | 2 | } |
53 | |
} |