View Javadoc

1   /*
2    * $Id: LoanBrokerApp.java 7976 2007-08-21 14:26:13Z dirk.olmes $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.com
5    *
6    * The software in this package is published under the terms of the CPAL v1.0
7    * license, a copy of which has been included with this distribution in the
8    * LICENSE.txt file.
9    */
10  
11  package org.mule.examples.loanbroker.esb;
12  
13  import org.mule.examples.loanbroker.AbstractLoanBrokerApp;
14  import org.mule.examples.loanbroker.LocaleMessage;
15  
16  import java.io.IOException;
17  
18  /**
19   * Runs the LoanBroker ESB example application.
20   */
21  
22  public class LoanBrokerApp extends AbstractLoanBrokerApp
23  {
24      public LoanBrokerApp(String config) throws Exception
25      {
26          super(config);
27      }
28  
29      public static void main(String[] args) throws Exception
30      {
31          LoanBrokerApp loanBrokerApp = null;
32          loanBrokerApp = new LoanBrokerApp(getInteractiveConfig());
33          loanBrokerApp.run(false);
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          response = readCharacter();
44          if (response == '1')
45          {
46              System.out.println(LocaleMessage.loadingEndpointEjb());
47              return "loan-broker-esb-mule-config.xml";
48          }
49          else
50          {
51              System.out.println(LocaleMessage.loadingManagedEjb());
52              return "loan-broker-esb-mule-config-with-ejb-container.xml";
53          }
54      }
55  }