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