Пример #1
0
 public static void main(String args[]) throws Exception {
   CreditAgencyServer server = new CreditAgencyServer();
   System.out.println("Server ready...");
   server.start();
   Thread.sleep(5 * 60 * 1000);
   System.out.println("Server exiting");
   server.stop();
   System.exit(0);
 }
Пример #2
0
  // START SNIPPET: server
  public static void main(String... args) throws Exception {
    CamelContext context = new DefaultCamelContext();
    CreditAgencyServer creditAgencyServer = new CreditAgencyServer();
    // Start the credit server
    creditAgencyServer.start();

    // Start the bank server
    BankServer bankServer = new BankServer();
    bankServer.start();

    // Start the camel context
    context.addRoutes(new LoanBroker());
    context.start();

    // Start the loan broker
    Thread.sleep(5 * 60 * 1000);
    context.stop();
    Thread.sleep(1000);
    bankServer.stop();
    creditAgencyServer.stop();
  }