Package org.eclipse.jetty.deploy

Examples of org.eclipse.jetty.deploy.DeploymentManager


    private static void scanDirForWebApps(final Server server, final String path) {
        WebAppProvider wap = new WebAppProvider();
        wap.setMonitoredDirName(path);
        wap.setExtractWars(true);

        DeploymentManager dm = new DeploymentManager();
        dm.setContexts(new ContextHandlerCollection());
        dm.addAppProvider(wap);

        server.setHandler(dm.getContexts());
        server.addBean(dm);
    }
View Full Code Here


        stats.setHandler(handlers);
       
        server.setHandler(stats);

        // Setup deployers
        DeploymentManager deployer = new DeploymentManager();
        deployer.setContexts(contexts);
        server.addBean(deployer);  
       
        OverlayedAppProvider provider = new OverlayedAppProvider();

        provider.setNodeName("nodeA");
        provider.setScanDir(new File(jetty_home + "/overlays"));
        provider.setScanInterval(2);
       
        deployer.addAppProvider(provider);

        server.setStopAtShutdown(true);
        //server.setSendServerVersion(true);
       
        // Uncomment to work with JNDI examples
View Full Code Here

        // Start it
        jetty.start();

        // monitor tick
        DeploymentManager dm = jetty.getServer().getBean(DeploymentManager.class);
        for (AppProvider provider : dm.getAppProviders())
        {
            if (provider instanceof ScanningAppProvider)
            {
                _providers++;
                ((ScanningAppProvider)provider).addScannerListener(new Scanner.ScanListener()
View Full Code Here

            }
        }
        else
        {
            //add some kind of default
            _deploymentManager = new DeploymentManager();
            _deploymentManager.setContexts(_ctxtCollection);
            _server.addBean(_deploymentManager);
        }

        _deploymentManager.setUseStandardBindings(false);
View Full Code Here

        sslConnector.setPort(8443);
        server.addConnector(sslConnector);


        // === jetty-deploy.xml ===
        DeploymentManager deployer = new DeploymentManager();
        deployer.setContexts(contexts);
        deployer.setContextAttribute(
                "org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern",
                ".*/servlet-api-[^/]*\\.jar$");

        WebAppProvider webapp_provider = new WebAppProvider();
        webapp_provider.setMonitoredDirName(jetty_base + "/webapps");
        webapp_provider.setDefaultsDescriptor(jetty_home + "/etc/webdefault.xml");
        webapp_provider.setScanInterval(1);
        webapp_provider.setExtractWars(true);
        webapp_provider.setConfigurationManager(new PropertiesConfigurationManager());

        deployer.addAppProvider(webapp_provider);
        server.addBean(deployer);
       
        // === setup jetty plus ==
        Configuration.ClassList.setServerDefault(server).addAfter(
                "org.eclipse.jetty.webapp.FragmentConfiguration",
View Full Code Here

        stats.setHandler(handlers);

        server.setHandler(stats);

        // Setup deployers
        DeploymentManager deployer = new DeploymentManager();
        deployer.setContexts(contexts);
        server.addBean(deployer);

        WebAppProvider webapp_provider = new WebAppProvider();
        webapp_provider.setMonitoredDirName(jetty_home + "/webapps");
        webapp_provider.setParentLoaderPriority(false);
        webapp_provider.setExtractWars(true);
        webapp_provider.setScanInterval(2);
        webapp_provider.setDefaultsDescriptor(jetty_home
                + "/etc/webdefault.xml");
        deployer.addAppProvider(webapp_provider);

        HashLoginService login = new HashLoginService();
        login.setName("Test Realm");
        login.setConfig(jetty_home + "/etc/realm.properties");
        server.addBean(login);
View Full Code Here

        {
            final AbstractNetworkConnector jettyConnector = createJettyConnector();

            configureConnector(jettyConnector, webappsConfiguration.getHost(), webappsConfiguration.getPort());

            DeploymentManager deploymentManager = new DeploymentManager();
            WebAppProvider webAppProvider = new WebAppProvider()
            {
                @Override
                public ContextHandler createContextHandler(App app) throws Exception
                {
                    WebAppContext webAppContext = (WebAppContext) super.createContextHandler(app);
                    if (webappsConfiguration.getServerClasses() != null)
                    {
                        webAppContext.setServerClasses(webappsConfiguration.getServerClasses());
                    }
                    if (webappsConfiguration.getSystemClasses() != null)
                    {
                        webAppContext.setSystemClasses(webappsConfiguration.getSystemClasses());
                    }


                    File workDir = new File(muleContext.getConfiguration().getWorkingDirectory(),
                                            "_exploded_wars" + webAppContext.getContextPath());
                    workDir.mkdirs();
                    webAppContext.setTempDirectory(workDir);
                    webAppContext.setAttribute(MULE_CONTEXT_ATTRIBUTE, muleContext);
                    webAppContext.setVirtualHosts(new String[] {getVirtualHostName(jettyConnector)});

                    if (logger.isInfoEnabled())
                    {
                        String msg = String.format("Will deploy a web app at %s://%s%s%s",
                                                   "http", jettyConnector.getHost(),
                                                   jettyConnector.getPort() == 80 ? StringUtils.EMPTY : ":" + jettyConnector.getPort(),
                                                   webAppContext.getContextPath());

                        logger.info(StringMessageUtils.getBoilerPlate(msg, '*', 70));
                    }

                    return webAppContext;
                }
            };

            deploymentManager.setContexts(contexts);
            deploymentManager.addAppProvider(webAppProvider);

            String webAppDir = webappsConfiguration.getDirectory();
            if (StringUtils.isBlank(webAppDir))
            {
                // if none specified, resolve defaults dynamically
View Full Code Here

TOP

Related Classes of org.eclipse.jetty.deploy.DeploymentManager

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.