Méthode main appelée par la JVM.
@param args String[]
@throws Exception e
169129
public static void main(String[] args) throws Exception {
		// if we need to daemonize, do it first,
		// (Non : http://fr.wikipedia.org/wiki/Nohup devrait suffire en général)
		//		for (int i = 0; i < args.length; i++) {
		//			if (args[i].startsWith("--daemon")) {
		//				// load the daemonization code
		//				ClassLoader cl = new URLClassLoader(
		//						new URL[] {
		//								extractFromJar("WEB-INF/lib/jna-3.0.9.jar", "jna", "jar").toURI()
		//										.toURL(),
		//								extractFromJar("WEB-INF/lib/akuma-1.1.jar", "akuma", "jar").toURI()
		//										.toURL(), });
		//				Class $daemon = cl.loadClass("com.sun.akuma.Daemon");
		//				Object daemon = $daemon.newInstance();
		//
		//				// tell the user that we'll be starting as a daemon.
		//				Method isDaemonized = $daemon.getMethod("isDaemonized", new Class[] {});
		//				if (!((Boolean) isDaemonized.invoke(daemon, new Object[0])).booleanValue()) {
		//					System.out.println("Forking into background to run as a daemon.");
		//					if (!hasLogOption(args))
		//						System.out.println("Use --logfile to redirect output to a file");
		//				}
		//
		//				Method m = $daemon.getMethod("all", new Class[] { boolean.class });
		//				m.invoke(daemon, new Object[] { Boolean.TRUE });
		//			}
		//		}

		// en commentaire car bug JENKINS-3272 (sous windows)
		// if the output should be redirect to a file, do it now
		//		for (int i = 0; i < args.length; i++) {
		//			if (args[i].startsWith("--logfile=")) {
		//				final LogFileOutputStream los = new LogFileOutputStream(new File(args[i]
		//						.substring("--logfile=".length())));
		//				final PrintStream ps = new PrintStream(los);
		//				System.setOut(ps);
		//				System.setErr(ps);
		//				// don't let winstone see this
		//				final List myArgs = new ArrayList(Arrays.asList(args));
		//				myArgs.remove(i);
		//				args = (String[]) myArgs.toArray(new String[myArgs.size()]);
		//				break;
		//			}
		//		}

		// this is so that JRobin can work nicely even if we are launched as a daemon
		System.setProperty("java.awt.headless", "true");

		final File me = whoAmI();
		getSystemOutputStream().println("Running from: " + me);
		System.setProperty("executable-war", me.getAbsolutePath()); // remember the location so that we can access it from within webapp

		// put winstone jar in a file system so that we can load jars from there
		final File tmpJar = extractFromJar("/winstone-jenkins.jar", "winstone", "jar");

		// clean up any previously extracted copy, since
		// winstone doesn't do so and that causes problems when newer version is deployed.
		final File tempFile = File.createTempFile("dummy", "dummy");
		deleteContents(new File(tempFile.getParent(), "winstone/" + me.getName()));
		deleteFile(tempFile);

		// locate the Winstone launcher
		final ClassLoader cl = new URLClassLoader(new URL[] { tmpJar.toURI().toURL() });
		final Class<?> launcher = cl.loadClass("winstone.Launcher");
		final Method mainMethod = launcher.getMethod("main", new Class<?>[] { String[].class });

		// figure out the arguments
		final List<String> arguments = new ArrayList<String>(Arrays.asList(args));
		arguments.add(0, "--warfile=" + me.getAbsolutePath());

		// override the usage screen
		final Field usage = launcher.getField("USAGE");
		usage.set(null, "JavaMelody Monitoring Collect Server " + "\n"
				+ "Usage: java -jar javamelody.war [--option=value] [--option=value]\n" + "\n"
				+ "Options:\n"
				+ "   --config                 = load configuration properties from here. Default is ./winstone.properties\n"
				+ "   --prefix                 = add this prefix to all URLs (eg http://localhost:8080/prefix/resource). Default is none\n"
				+ "   --commonLibFolder        = folder for additional jar files. Default is ./lib\n"
				+ "   \n"
				+ "   --logThrowingLineNo      = show the line no that logged the message (slow). Default is false\n"
				+ "   --logThrowingThread      = show the thread that logged the message. Default is false\n"
				+ "   --debug                  = set the level of debug msgs (1-9). Default is 5 (INFO level)\n"
				+ "\n"
				+ "   --httpPort               = set the http listening port. -1 to disable, Default is 8080\n"
				+ "   --httpListenAddress      = set the http listening address. Default is all interfaces\n"
				+ "   --httpDoHostnameLookups  = enable host name lookups on incoming http connections (true/false). Default is false\n"
				+ "   --httpKeepAliveTimeout   = how long idle HTTP keep-alive connections are kept around (in ms; default 5000)?\n"
				+ "   --httpsPort              = set the https listening port. -1 to disable, Default is disabled\n"
				+ "                              if neither --httpsCertificate nor --httpsKeyStore are specified,\n"
				+ "                              https is run with one-time self-signed certificate.\n"
				+ "   --httpsListenAddress     = set the https listening address. Default is all interfaces\n"
				+ "   --httpsDoHostnameLookups = enable host name lookups on incoming https connections (true/false). Default is false\n"
				+ "   --httpsKeepAliveTimeout   = how long idle HTTPS keep-alive connections are kept around (in ms; default 5000)?\n"
				+ "   --httpsKeyStore          = the location of the SSL KeyStore file.\n"
				+ "   --httpsKeyStorePassword  = the password for the SSL KeyStore file. Default is null\n"
				+ "   --httpsCertificate       = the location of the PEM-encoded SSL certificate file.\n"
				+ "                              (the one that starts with '-----BEGIN CERTIFICATE-----')\n"
				+ "                              must be used with --httpsPrivateKey.\n"
				+ "   --httpsPrivateKey        = the location of the PEM-encoded SSL private key.\n"
				+ "                              (the one that starts with '-----BEGIN RSA PRIVATE KEY-----')\n"
				+ "   --httpsKeyManagerType    = the SSL KeyManagerFactory type (eg SunX509, IbmX509). Default is SunX509\n"
				+ "   --spdy                   = Enable SPDY. See http://wiki.eclipse.org/Jetty/Feature/NPN\n"
				+ "   --ajp13Port              = set the ajp13 listening port. -1 to disable, Default is disabled\n"
				+ "   --ajp13ListenAddress     = set the ajp13 listening address. Default is all interfaces\n"
				+ "   --controlPort            = set the shutdown/control port. -1 to disable, Default disabled\n"
				+ "   \n"
				+ "   --handlerCountStartup    = set the no of worker threads to spawn at startup. Default is 5\n"
				+ "   --handlerCountMax        = set the max no of worker threads to allow. Default is 40\n"
				+ "   --handlerCountMaxIdle    = set the max no of idle worker threads to allow. Default is 5\n"
				+ "   \n"
				+ "   --sessionTimeout         = set the http session timeout value in minutes. Default to what webapp specifies, and then to 60 minutes\n"
				+ "   --mimeTypes=ARG          = define additional MIME type mappings. ARG would be EXT=MIMETYPE:EXT=MIMETYPE:...\n"
				+ "                              (e.g., xls=application/vnd.ms-excel:wmf=application/x-msmetafile)\n"
				+ "   --maxParamCount=N        = set the max number of parameters allowed in a form submission to protect\n"
				+ "                              against hash DoS attack (oCERT #2011-003). Default is 10000.\n"
				+ "   --usage / --help         = show this message\n" + "   \n"
				// For security of the collect server, see https://github.com/javamelody/javamelody/wiki/UserGuideAdvanced#5-security-with-a-collect-server
				// (-Djavamelody.authorized-users=user1:pwd1,user2:pwd2)
				//						+ "Security options:\n"
				//						+ "   --realmClassName               = Set the realm class to use for user authentication. Defaults to ArgumentsRealm class\n"
				//						+ "   \n"
				//						+ "   --argumentsRealm.passwd.<user> = Password for user <user>. Only valid for the ArgumentsRealm realm class\n"
				//						+ "   --argumentsRealm.roles.<user>  = Roles for user <user> (comma separated). Only valid for the ArgumentsRealm realm class\n"
				//						+ "   \n"
				//						+ "   --fileRealm.configFile         = File containing users/passwds/roles. Only valid for the FileRealm realm class\n"
				//						+ "   \n"
				+ "Access logging:\n"
				+ "   --accessLoggerClassName        = Set the access logger class to use for user authentication. Defaults to disabled\n"
				+ "   --simpleAccessLogger.format    = The log format to use. Supports combined/common/resin/custom (SimpleAccessLogger only)\n"
				+ "   --simpleAccessLogger.file      = The location pattern for the log file(SimpleAccessLogger only)");
		// run
		mainMethod.invoke(null, new Object[] { arguments.toArray(new String[arguments.size()]) });
	}
739342
public static void main(String[] argv) throws Exception {
    System.exit(ToolRunner.run(null, new PiEstimator(), argv));
  }
1354306
public static void main(String[] args) throws Exception {
    int exitCode = ToolRunner.run(new gen_flatfile(), args);
    System.exit(exitCode);
  }
581651
@SuppressWarnings("InfiniteLoopStatement")
	public static void main(String[] args) throws Exception {
		LoggingCallback loggingCallback = new LoggingCallback();
		loggingCallback.setLevel(Level.INFO);
		SimonManager.callback().addCallback(loggingCallback);
		Random random = new Random();

		register();
		try {
			while (true) {
				final int task = random.nextInt(TASK_SPREAD) + TASK_MIN;
				new Thread() {
					public void run() {
						try (Split split = SimonManager.getStopwatch(TASK_STOPWATCH).start()) {
							Thread.sleep(task);
						} catch (InterruptedException e) {
							e.printStackTrace();
						}
					}
				}.start();
				int sleep = random.nextInt(NEW_TASK_SPREAD) + NEW_TASK_MIN;
				Thread.sleep(sleep);
			}
		} finally {
			unregister();
		}
	}
722494
public static void main(String[] args) throws Exception {
        setCustomErrStream();

        CommandLine cmdLine = null;
        try {
            cmdLine = new CommandLine(args != null ? Arrays.copyOf(args, args.length) : null);

        } catch (final Exception e) {
        	// Cant use the CommandLine help here as the 
        	// i18n messages wont have been loaded
            System.out.println("Failed due to invalid parameters: " + Arrays.toString(args));
            System.out.println(e.getMessage());
            System.out.println("Use '-h' for more details.");
            System.exit(1);
        }

        ZapBootstrap bootstrap = createZapBootstrap(cmdLine);
        try {
            int rc = bootstrap.start();
            if (rc != 0) {
                System.exit(rc);
            }

        } catch (final Exception e) {
            logger.fatal(e.getMessage(), e);
            System.exit(1);
        }

    }
716407
public static final void main(String [] args) throws Exception {
        ManagerApiMicroService microService = new ManagerApiMicroService();
        microService.start();
        microService.join();
    }
820019
public void run(String... args) throws Exception {
        ClassLoader old = Thread.currentThread().getContextClassLoader();
        Thread.currentThread().setContextClassLoader( classLoader  );

        try {
            doRun( args);
        } catch (Exception e) {
            monitor.exceptionOccured( e );
        }

        Thread.currentThread().setContextClassLoader( old );
    }
1354933
@SuppressWarnings("InfiniteLoopStatement")
	public static void main(String[] args) throws Exception {
		SimonManager.callback().addCallback(new JmxRegisterCallback("org.javasimon.examples.jmx.JmxCallbackExample"));

		Counter counter = SimonManager.getCounter("org.javasimon.examples.jmx.counter");
		Stopwatch stopwatch = SimonManager.getStopwatch("org.javasimon.examples.jmx.stopwatch");
		// these created just to have more stuff in jconsole
		SimonManager.getCounter("org.javasimon.different.counter");
		SimonManager.getStopwatch("org.javasimon.some.other.jmx.stopwatch1");
		SimonManager.getStopwatch("org.javasimon.some.other.jmx.stopwatch2");
		System.out.println("Now open jconsole and check it out...\nWatch org.javasimon.examples.jmx.stopwatch for changes.");
		while (true) {
			counter.increase();
			try (Split ignored = stopwatch.start()) {
				ExampleUtils.waitRandomlySquared(40);
			}
		}
	}
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);
		}
	}
371599
public static void main(String[] args) throws Exception {
    ArgP argp = new ArgP();
    argp.addOption("--help", "Print help information.");
    CliOptions.addCommon(argp);
    FsckOptions.addDataOptions(argp);
    args = CliOptions.parse(argp, args);

    if (argp.has("--help")) {
      usage(argp, "", 0);
    }

    Config config = CliOptions.getConfig(argp);
    final FsckOptions options = new FsckOptions(argp, config);
    final TSDB tsdb = new TSDB(config);
    final ArrayList<Query> queries = new ArrayList<Query>();
    if (args != null && args.length > 0) {
      CliQuery.parseCommandLineQuery(args, tsdb, queries, null, null);
    }
    if (queries.isEmpty() && !argp.has("--full-scan")) {
      usage(argp, "Must supply a query or use the '--full-scan' flag", 1);
    }
    tsdb.checkNecessaryTablesExist().joinUninterruptibly();

    argp = null;
    final Fsck fsck = new Fsck(tsdb, options);
    try {
      if (!queries.isEmpty()) {
        fsck.runQueries(queries);
      } else {
        fsck.runFullTable();
      }
    } finally {
      tsdb.shutdown().joinUninterruptibly();
    }
    System.exit(fsck.totalErrors() == 0 ? 0 : 1);
  }
1368589
public static void main(final String[] args) throws Exception {
		// Set the logger to use the text area logger
		System.setProperty("org.apache.commons.logging.Log",
				"com.github.bordertech.wcomponents.lde.StandaloneLauncher$TextAreaLogger");

		// Set the port number to a random port
		Configuration internalWComponentConfig = Config.getInstance();
		CompositeConfiguration config = new CompositeConfiguration(new MapConfiguration(
				new HashMap<String, Object>()));
		config.addConfiguration(internalWComponentConfig); // Internal WComponent config next
		config.setProperty(ConfigurationProperties.LDE_SERVER_PORT, 0);
		Config.setConfiguration(config);

		getInstance().launcher.run();
		getInstance().log("LDE now running on " + getInstance().launcher.getUrl() + '\n');
	}
368085
public static void main(final String... args) throws Exception {

        final StorageConfiguration config = new StorageConfiguration(new File(args[0]));
        Storage.createStorage(config);
        final IStorage storage = Storage.openStorage(new File(args[0]));

        Injector injector =
            Guice.createInjector(new ModuleSetter().setDataFacClass(TreeNodeFactory.class).setMetaFacClass(
                NodeMetaPageFactory.class).createModule());
        IBackendFactory backend = injector.getInstance(IBackendFactory.class);
        IRevisioning revision = injector.getInstance(IRevisioning.class);
        Properties props = new Properties();
        props.setProperty(ConstructorProps.STORAGEPATH, storage.getLocation().getAbsolutePath());
        props.setProperty(ConstructorProps.RESOURCE, "shredded");
        storage.createResource(new ResourceConfiguration(props, backend, revision, new TreeNodeFactory(),
            new NodeMetaPageFactory()));
        final ISession session =
            storage.getSession(new SessionConfiguration("shredded", StandardSettings.KEY));

        final DefaultHandler defHandler = new DefaultHandler();

        final SAXSerializer serializer = new SAXSerializer(session, defHandler);
        serializer.call();

        session.close();
    }
247521
public static void main(String[] args) {
        System.exit(call(System.out, System.err, args) ? 0 : 1);
    }
202685
public static void main(String args[]) throws Exception {
        final StringBuffer buffer = new StringBuffer("The lazy fox");
        Thread t1 = new Thread() {
            public void run() {
                synchronized(buffer) {
                    buffer.delete(0,4);
                    buffer.append(" in the middle");
                    System.err.println("Middle");
                    try { Thread.sleep(4000); } catch(Exception e) {}
                    buffer.append(" of fall");
                    System.err.println("Fall");
                }
            }
        };
        Thread t2 = new Thread() {
            public void run() {
                try { Thread.sleep(1000); } catch(Exception e) {}
                buffer.append(" jump over the fence");
                System.err.println("Fence");
            }
        };
        t1.start();
        t2.start();

        t1.join();
        t2.join();
        System.err.println(buffer);
    }
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);
        }
    }
131921
public static void main(final String... args) throws Exception {
        try (ConfigurableApplicationContext context = SpringApplication.run(Application.class, args)) {
            log.info("Arguments: {}", Arrays.asList(args));

            try {
                context.getBean(Application.class).run(context);
            } catch (Exception e) {
                log.error("Exception in command execution", e);
            }
        }
    }
1335189
public static void main(String argv[]) throws Exception {
    try {
      Configuration conf = new Configuration();
      UtilizationReporter utilizationReporter = 
              new UtilizationReporter(conf);
      utilizationReporter.start();
    } catch (Throwable e) {
      System.err.println(e);
      LOG.error(StringUtils.stringifyException(e));
      System.exit(-1);
    }
  }