1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
package org.mule.example.loanbroker.esb; |
8 | |
|
9 | |
import org.mule.example.loanbroker.AbstractLoanBrokerApp; |
10 | |
import org.mule.example.loanbroker.LocaleMessage; |
11 | |
import org.mule.util.StringUtils; |
12 | |
|
13 | |
import java.io.IOException; |
14 | |
|
15 | |
|
16 | |
|
17 | |
|
18 | |
|
19 | |
public class LoanBrokerApp extends AbstractLoanBrokerApp |
20 | |
{ |
21 | |
public LoanBrokerApp(String config) throws Exception |
22 | |
{ |
23 | 0 | super(config); |
24 | 0 | } |
25 | |
|
26 | |
public static void main(String[] args) throws Exception |
27 | |
{ |
28 | 0 | String config = getInteractiveConfig(); |
29 | 0 | if (StringUtils.isNotEmpty(config)) |
30 | |
{ |
31 | 0 | LoanBrokerApp loanBrokerApp = new LoanBrokerApp(config); |
32 | 0 | loanBrokerApp.run(false); |
33 | |
} |
34 | 0 | } |
35 | |
|
36 | |
protected static String getInteractiveConfig() throws IOException |
37 | |
{ |
38 | 0 | int response = 0; |
39 | |
|
40 | 0 | System.out.println("******************\n" |
41 | |
+ LocaleMessage.esbWelcome() |
42 | |
+ "\n******************"); |
43 | |
|
44 | 0 | while (response != 'q') |
45 | |
{ |
46 | 0 | response = readCharacter(); |
47 | 0 | if (response == '1') |
48 | |
{ |
49 | 0 | System.out.println(LocaleMessage.loadingEndpointEjb()); |
50 | 0 | return "loan-broker-esb-mule-config.xml"; |
51 | |
} |
52 | |
else |
53 | |
{ |
54 | 0 | System.out.println(LocaleMessage.loadingManagedEjb()); |
55 | 0 | return "loan-broker-esb-mule-config-with-ejb-container.xml"; |
56 | |
} |
57 | |
} |
58 | |
|
59 | 0 | return ""; |
60 | |
} |
61 | |
} |