Main entry point for the API Gateway micro service.
@param args the arguments
@throws Exception when any unhandled exception occurs
196147
public static final void main(String [] args) throws Exception {
        GatewayMicroService microService = new GatewayMicroService();
        microService.start();
        microService.join();
    }
775873
public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					BootstrapWindow frame = new BootstrapWindow();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}
886949
public static void main(Class main, String[] args) throws Exception {
    String[] packageNamesToWeave = { main.getPackage().getName()} ;
    main(main, args, packageNamesToWeave);
  }
96445
public static void main(String[] args) throws Exception {
        java.io.PrintWriter out = new java.io.PrintWriter(System.out);
        new RuntimeWSDL(new File(args[0]), new File(args[1]), args[2])
                .serialize(out);
        out.flush();
    }
1276765
public static void main(String[] args) throws Exception {
    //#thriftclientapi
    Hello.FutureIface client = Thrift.client().newIface("localhost:8080", Hello.FutureIface.class);
    Future<String> response = client.hi().onSuccess(new Function<String, BoxedUnit>() {
      @Override
      public BoxedUnit apply(String response) {
        System.out.println("Received response: " + response);
        return null;
      }
    });

    Await.result(response);
    //#thriftclientapi
  }
786138
public static void main(String argv[]) throws Exception {
    FreightStreamer streamer = new FreightStreamer();
    int res;
    try {
      res = ToolRunner.run(streamer, argv);
    } finally {
      streamer.close();
    }
    System.exit(res);
  }
579211
public static void main(String[] arg)
    {
        String opt;	
        opt = System.getProperty("SERVICE_OUT");
        if (opt != null)
        {
            try
            {
                PrintStream stdout = new PrintStream(new FileOutputStream(opt));
                System.setOut(stdout);
            }
            catch(Exception e){log.warn(LogSupport.EXCEPTION,e);}
        }
		
        opt = System.getProperty("SERVICE_ERR");
        if (opt != null)
        {
            try
            {
                PrintStream stderr = new PrintStream(new FileOutputStream(opt));
                System.setErr(stderr);
            }
            catch(Exception e){log.warn(LogSupport.EXCEPTION,e);}
        }
        
        
        if (arg.length==0)
            arg=new String[] {"etc/jetty.xml"};
        
        try
        {
            _configs=new Vector();
            for (int i=0;i<arg.length;i++)
                _configs.add(arg[i]);
            createAll();
            startAll();
        }
        catch(Exception e)
        {
            log.warn(LogSupport.EXCEPTION,e);
        }
    }
933919
public static void main(final String[] args)
			throws Exception {
		// Use jetty to run the servlet.
		Server server = new Server();

		SocketConnector connector = new SocketConnector();
		connector.setMaxIdleTime(0);
		connector.setPort(8080);
		server.addConnector(connector);

		WebAppContext context = new WebAppContext();
		context.setContextPath("/");
		context.addServlet(HelloWServlet.class.getName(), "/*");
		context.addServlet(ThemeServlet.class.getName(), "/theme/*");
		context.setResourceBase(".");

		server.setHandler(context);
		server.start();
	}
712126
public static void main(String[] args) throws Exception {
    StructureGenerator sg = new StructureGenerator();
    System.exit(sg.run(args));
  }
685492
@Override
    public void launch() throws Exception {

        if (baseGateway != null) {
            baseGateway.launch();
        }

        if (gateway != null) {
            throw new GatewayAlreadyRunningException("An instance of the Gateway is already running");
        }

        Properties configuration = getProperties();
        if (configuration == null) {
            // Change to a public exception once all calls to System.getProperty() throughout the entire
            // codebase have been eliminated.
            //
            throw new Exception("No environment has been specified");
        }

        if (!supportedJavaVersion(1, 8, "0")) {
            throw new RuntimeException("Unsupported JDK version, Please install Java SE 8.0 or later and relaunch " +
                    "Kaazing WebSocket Gateway");
        }

        String gatewayHomeProperty = configuration.getProperty(GATEWAY_HOME_PROPERTY);
        if (gatewayHomeProperty == null) {
            throw new IllegalArgumentException(GATEWAY_HOME_PROPERTY + " directory was not specified");
        }

        File homeDir = new File(gatewayHomeProperty);
        if (!homeDir.isDirectory()) {
            throw new IllegalArgumentException(GATEWAY_HOME_PROPERTY + " is not a valid directory: "
                    + homeDir.getAbsolutePath());
        }

        String gatewayConfigDirectoryProperty = configuration.getProperty(GATEWAY_CONFIG_DIRECTORY_PROPERTY);
        File configDir = (gatewayConfigDirectoryProperty != null)
                         ? new File(gatewayConfigDirectoryProperty)
                         : new File(homeDir, DEFAULT_CONFIG_DIRECTORY);
        if (!configDir.isDirectory()) {
            throw new IllegalArgumentException(GATEWAY_CONFIG_DIRECTORY_PROPERTY + " is not a valid directory: "
                    + configDir.getAbsolutePath());
        }

        // Login modules needs the CONFIG directory, put it back into the configuration properties.
        configuration.setProperty(GATEWAY_CONFIG_DIRECTORY_PROPERTY, configDir.toString());

        String gatewayTempDirectoryProperty = configuration.getProperty(GATEWAY_TEMP_DIRECTORY_PROPERTY);
        File tempDir = (gatewayTempDirectoryProperty != null)
                       ? new File(gatewayTempDirectoryProperty)
                       : new File(homeDir, DEFAULT_TEMP_DIRECTORY);
        if (!tempDir.isDirectory()) {
            throw new IllegalArgumentException(GATEWAY_TEMP_DIRECTORY_PROPERTY + " is not a valid directory: "
                    + tempDir.getAbsolutePath());
        }

        String gatewayLogDirectoryProperty = configuration.getProperty(GATEWAY_LOG_DIRECTORY_PROPERTY);
        File logDir = (gatewayLogDirectoryProperty != null)
                      ? new File(gatewayLogDirectoryProperty)
                      : new File(homeDir, DEFAULT_LOG_DIRECTORY);
        if (!logDir.exists()) {
            logDir.mkdir();
        }
        if (!logDir.isDirectory()) {
            throw new IllegalArgumentException(GATEWAY_LOG_DIRECTORY_PROPERTY
                    + " is not a valid directory or could not be created: " + logDir.getAbsolutePath());
        }

        // Because we use Log4J and it contains a reference to ${GATEWAY_LOG_DIRECTORY},
        // we need to make sure to put the log directory back into the configuration properties.
        configuration.setProperty(GATEWAY_LOG_DIRECTORY_PROPERTY, logDir.toString());

        // As of 3.2 we will normally have two config files in the config directory (if you
        // have the 'full' installation), one for the 'minimal' configuration (that you would
        // get if you just have a base installation) and one for the demos and docs.  To decide
        // on the config file to use we'll have the following rules:
        //  * If there is a config specified as a system property, we'll use that.
        //  * If there is no config specified, we'll look for the default "full" gateway config.
        //    (of course, the user may have modified that file and just be using the same name.)
        //  * If that doesn't exist, we'll look for the default "minimal" gateway config.
        //  * If none of those exists (and is a readable file), that's an error.
        File gatewayConfigFile;
        String gatewayConfigProperty = configuration.getProperty(GATEWAY_CONFIG_PROPERTY);

        // If config property is a url then we download it and reset the property
        try {
            // if config is a URL download it to config directory
            URL configURL = new URL(gatewayConfigProperty);
            String path = configURL.getPath();
            ReadableByteChannel rbc = Channels.newChannel(configURL.openStream());
            final File configFile = new File(configDir, path.substring(path.lastIndexOf('/') + 1));
            try (FileOutputStream fos = new FileOutputStream(configFile)) {
                fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
            }
            configuration.setProperty(Gateway.GATEWAY_CONFIG_PROPERTY, configFile.getPath());
            gatewayConfigProperty = configuration.getProperty(GATEWAY_CONFIG_PROPERTY);
        } catch (MalformedURLException e1) {
            // expected exception if config is not a url
        } catch (IOException e) {
            throw new RuntimeException("Could not fetch config from url: " + gatewayConfigProperty, e);
        }

        if (gatewayConfigProperty != null) {
            gatewayConfigFile = new File(gatewayConfigProperty);
            if (!gatewayConfigFile.isFile() || !gatewayConfigFile.canRead()) {
                throw new IllegalArgumentException(GATEWAY_CONFIG_PROPERTY
                        + " was specified but is not a valid, readable file: "
                        + gatewayConfigFile.getAbsolutePath());
            }
        } else {
            gatewayConfigFile = new File(configDir, DEFAULT_GATEWAY_CONFIG_XML);
            if (!gatewayConfigFile.exists()) {
                gatewayConfigFile = new File(configDir, DEFAULT_GATEWAY_CONFIG_MINIMAL_XML);
            }
            if (!gatewayConfigFile.isFile() || !gatewayConfigFile.canRead()) {
                throw new IllegalArgumentException(GATEWAY_CONFIG_PROPERTY
                        + " was not specified, and no default readable config file"
                        + " could be found in the conf/ directory");
            }
        }

        String gatewayWebDirectoryProperty = configuration.getProperty(GATEWAY_WEB_DIRECTORY_PROPERTY);
        File webRootDir = (gatewayWebDirectoryProperty != null)
                          ? new File(gatewayWebDirectoryProperty)
                          : new File(homeDir, DEFAULT_WEB_DIRECTORY);
        if (!webRootDir.exists()) {
            webRootDir.mkdir();
        }
        if (!webRootDir.isDirectory()) {
            throw new IllegalArgumentException(GATEWAY_WEB_DIRECTORY_PROPERTY
                    + " is not a valid directory or could not be created: " + webRootDir.getAbsolutePath());
        }

        String overrideLogging = configuration.getProperty(OVERRIDE_LOGGING);
        if ((overrideLogging == null) || !Boolean.parseBoolean(overrideLogging)) {
            configureLogging(configDir, configuration);
        }

        duplicateJarFinder.findDuplicateJars();

        displayVersionInfo();

        LOGGER.info("Configuration file: " + gatewayConfigFile.getCanonicalPath());

        GatewayObserverApi gatewayObserver = GatewayObserver.newInstance();
        GatewayConfigParser parser = new GatewayConfigParser(configuration);
        GatewayConfigDocument config = parser.parse(gatewayConfigFile);
        GatewayContextResolver resolver = new GatewayContextResolver(configDir, webRootDir, tempDir, jmxMBeanServer);
        gatewayObserver.initingGateway(configuration, resolver.getInjectables());
        ConfigurationObserver confObserver = ConfigurationObserver.newInstance();
        resolver.setObserver(confObserver);
        GatewayContext context = resolver.resolve(config, configuration);

        gateway = new Launcher(gatewayObserver);

        try {
            gateway.init(context);
        } catch (Exception e) {
            LOGGER.error(String.format("Error starting Gateway: caught exception %s", e));
            throw e;
        }
    }
1170815
public static void main(String[] args) {
        PageFetcher p = new PageFetcher();
        System.out.println(p.getPageHtml("http://sync-report.beidou.baidu.com/service_api"));
    }
770925
public static void main(String[] args) {
		try {
			int result = new EasyJaSubCommandLineApp(new EasyJaSubCommandLine())
					.run(args, new PrintWriter(System.out), new PrintWriter(
							System.err));
			System.exit(result);
		} catch (Exception e) {
			System.err.println("Unhandled application error:");
			e.printStackTrace(System.err);
			System.exit(-1000);
		}
	}
560539
public static void main(String [] args){
		ServiceOption option = new ServiceOption();
		CmdLineParser parser = new CmdLineParser(option);
		
		if (args.length == 0) {
			System.out.println("TaggingService [options...] [arguments..]");
			parser.printUsage(System.out);
			return;
		}
		new TaggingService(option).run();
	}
946456
public static void main(String[] args) {
        try {
            new StartMain(args).go();
        } catch(Throwable t) {
            WeldSELogger.LOG.error("Application exited with an exception", t);
            System.exit(1);
        }
    }
355782
public static void main(String[] args) throws Exception {
      String hostPort = "";
      if (args.length > 0) {
        hostPort = args[0];
      }
      JmxCollector jc = new JmxCollector(("{"
      + "`hostPort`: `" + hostPort + "`,"
      + "}").replace('`', '"'));
      for(MetricFamilySamples mfs : jc.collect()) {
        System.out.println(mfs);
      }
    }
1359478
public static void main(String[] args) throws Exception {
    boolean usage = false;
    int serverPort = 0;
    int driverPort = 0;
    for (String arg : args) {
      if (!arg.startsWith("--")) {
        System.err.println("All arguments must start with '--': " + arg);
        usage = true;
        break;
      }
      String[] parts = arg.substring(2).split("=", 2);
      String key = parts[0];
      if ("help".equals(key)) {
        usage = true;
        break;
      }
      if (parts.length != 2) {
        System.err.println("All arguments must be of the form --arg=value");
        usage = true;
        break;
      }
      String value = parts[1];
      if ("server_port".equals(key)) {
        serverPort = Integer.valueOf(value);
      } else if ("driver_port".equals(key)) {
        driverPort = Integer.valueOf(value);
      } else {
        System.err.println("Unknown argument: " + key);
        usage = true;
        break;
      }
    }
    if (usage || driverPort == 0) {
      System.err.println(
          "Usage: [ARGS...]"
              + "\n"
              + "\n  --driver_port=<port>"
              + "\n    Port to expose grpc.testing.WorkerService, used by driver to initiate work."
              + "\n  --server_port=<port>"
              + "\n    Port to start load servers on. Defaults to any available port");
      System.exit(1);
    }


    // important to enable HTTP/2 in ActorSystem's config
    Config conf = ConfigFactory.parseString("akka.http.server.preview.enable-http2 = on")
        .withFallback(ConfigFactory.defaultApplication());
    ActorSystem system = ActorSystem.create("LoadWorker", conf);
    new LoadWorker(system, driverPort, serverPort).start();
  }
398406
public static void main(String[] args) {
        int exitCode = 0;
        final App app = new App();
        exitCode = app.run(args);
        LOGGER.debug("Exit code: {}", exitCode);
        System.exit(exitCode);
    }