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