Package org.gradle.logging

Examples of org.gradle.logging.ProgressLoggerFactory


        validateConfiguration();
        startJettyInternal();
    }

    public void startJettyInternal() {
        ProgressLoggerFactory progressLoggerFactory = getServices().get(ProgressLoggerFactory.class);
        ProgressLogger progressLogger = progressLoggerFactory.newOperation(AbstractJettyRunTask.class)
                .start("Start Jetty server", "Starting Jetty");
        try {
            setServer(createServer());

            applyJettyXml();

            JettyPluginServer plugin = getServer();

            Object[] configuredConnectors = getConnectors();

            plugin.setConnectors(configuredConnectors);
            Object[] connectors = plugin.getConnectors();

            if (connectors == null || connectors.length == 0) {
                configuredConnectors = new Object[]{plugin.createDefaultConnector(getHttpPort())};
                plugin.setConnectors(configuredConnectors);
            }

            //set up a RequestLog if one is provided
            if (getRequestLog() != null) {
                getServer().setRequestLog(getRequestLog());
            }

            //set up the webapp and any context provided
            getServer().configureHandlers();
            configureWebApplication();
            getServer().addWebApplication(webAppConfig);

            // set up security realms
            Object[] configuredRealms = getUserRealms();
            for (int i = 0; (configuredRealms != null) && i < configuredRealms.length; i++) {
                logger.debug(configuredRealms[i].getClass().getName() + ": " + configuredRealms[i].toString());
            }

            plugin.setUserRealms(configuredRealms);

            //do any other configuration required by the
            //particular Jetty version
            finishConfigurationBeforeStart();

            // start Jetty
            server.start();

            if (daemon) {
                return;
            }

            if (getStopPort() != null && getStopPort() > 0 && getStopKey() != null) {
                Monitor monitor = new Monitor(getStopPort(), getStopKey(), (Server) server.getProxiedObject());
                monitor.start();
            }

            // start the scanner thread (if necessary) on the main webapp
            configureScanner();
            startScanner();

            // start the new line scanner thread if necessary
            startConsoleScanner();

        } catch (Exception e) {
            throw new GradleException("Could not start the Jetty server.", e);
        } finally {
            progressLogger.completed();
        }

        progressLogger = progressLoggerFactory.newOperation(AbstractJettyRunTask.class)
                .start(String.format("Run Jetty at http://localhost:%d/%s", getHttpPort(), getContextPath()),
                        String.format("Running at http://localhost:%d/%s", getHttpPort(), getContextPath()));
        try {
            // keep the thread going if not in daemon mode
            server.join();
View Full Code Here

TOP

Related Classes of org.gradle.logging.ProgressLoggerFactory

Copyright © 2018 www.massapicom. 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.