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