Package com.hascode.tutorial.app

Source Code of com.hascode.tutorial.app.Main

package com.hascode.tutorial.app;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

import org.apache.catalina.LifecycleException;

import com.hascode.tutorial.container.JettyEmbeddedRunner;
import com.hascode.tutorial.container.TomcatEmbeddedRunner;

public class Main {
  public static void main(final String[] args) throws IOException,
      LifecycleException {
    System.out
        .println("### STARTING EMBEDDED WEB CONTAINER\nPlease select your container...\n1) Jetty\n2) Tomcat\n");
    BufferedReader bufferRead = new BufferedReader(new InputStreamReader(
        System.in));
    String input = bufferRead.readLine();
    if ("1".equals(input)) {
      System.out.println("Starting Jetty ..");
      new JettyEmbeddedRunner().startServer();
    } else if ("2".equals(input)) {
      System.out.println("Starting Tomcat ..");
      new TomcatEmbeddedRunner().startServer();
    } else {
      System.out.println("Nothing selected .. quitting application...");
    }

  }
}
TOP

Related Classes of com.hascode.tutorial.app.Main

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.