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 super(config);
28 }
29
30 public static void main(String[] args) throws Exception
31 {
32 String config = getInteractiveConfig();
33 if (StringUtils.isNotEmpty(config))
34 {
35 LoanBrokerApp loanBrokerApp = new LoanBrokerApp(config);
36 loanBrokerApp.run(false);
37 }
38 }
39
40 protected static String getInteractiveConfig() throws IOException
41 {
42 int response = 0;
43
44 System.out.println("******************\n"
45 + LocaleMessage.esbWelcome()
46 + "\n******************");
47
48 while (response != 'q')
49 {
50 response = readCharacter();
51 if (response == '1')
52 {
53 System.out.println(LocaleMessage.loadingEndpointEjb());
54 return "loan-broker-esb-mule-config.xml";
55 }
56 else
57 {
58 System.out.println(LocaleMessage.loadingManagedEjb());
59 return "loan-broker-esb-mule-config-with-ejb-container.xml";
60 }
61 }
62
63 return "";
64 }
65 }