Package org.eclipse.jetty.deploy.providers

Examples of org.eclipse.jetty.deploy.providers.WebAppProvider


        ds.setURL(url);
        return ds;
    }

    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);
View Full Code Here


        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 ==
View Full Code Here

        // 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");
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
                final String appDir = muleContext.getRegistry().get(MuleProperties.APP_HOME_DIRECTORY_PROPERTY);
                webAppDir = appDir + "/webapps";
            }

            if (configFile == null)
            {
                // override only if user hasn't specified one (turn off file-mapped buffer for
                // static files to avoid resource locking, makes webapp resources editable on the fly)
                final URL muleDefaults = ClassUtils.getResource("org/mule/transport/jetty/webdefault.xml", getClass());
                webAppProvider.setDefaultsDescriptor(muleDefaults.toExternalForm());
            }

            webAppProvider.setMonitoredDirName(webAppDir);
            webAppProvider.setExtractWars(true);
            webAppProvider.setParentLoaderPriority(false);

            String[] confClasses = new String[]
            {
                // configures webapp's classloader as a child of a Mule app classloader
                WebInfConfiguration.class.getName(),
                WebXmlConfiguration.class.getName()
            };
            webAppProvider.setConfigurationClasses(confClasses);
            webAppProvider.setDeploymentManager(deploymentManager);

            httpServer.addBean(deploymentManager);
            httpServer.addConnector(jettyConnector);
        }

View Full Code Here

TOP

Related Classes of org.eclipse.jetty.deploy.providers.WebAppProvider

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.