Search in sources :

Example 6 with DeploymentManager

use of org.eclipse.jetty.deploy.DeploymentManager in project jetty.project by eclipse.

the class ScanningAppProviderRuntimeUpdatesTest method setupEnvironment.

@Before
public void setupEnvironment() throws Exception {
    testdir.ensureEmpty();
    Resource.setDefaultUseCaches(false);
    jetty = new XmlConfiguredJetty(testdir);
    jetty.addConfiguration("jetty.xml");
    jetty.addConfiguration("jetty-http.xml");
    jetty.addConfiguration("jetty-deploymgr-contexts.xml");
    // Should not throw an Exception
    jetty.load();
    // 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() {

                public void scan() {
                    _scans.incrementAndGet();
                }
            });
        }
    }
}
Also used : Scanner(org.eclipse.jetty.util.Scanner) AppProvider(org.eclipse.jetty.deploy.AppProvider) DeploymentManager(org.eclipse.jetty.deploy.DeploymentManager) XmlConfiguredJetty(org.eclipse.jetty.deploy.test.XmlConfiguredJetty) Before(org.junit.Before)

Aggregations

DeploymentManager (org.eclipse.jetty.deploy.DeploymentManager)6 File (java.io.File)4 ContextHandlerCollection (org.eclipse.jetty.server.handler.ContextHandlerCollection)4 HandlerCollection (org.eclipse.jetty.server.handler.HandlerCollection)3 StatisticsHandler (org.eclipse.jetty.server.handler.StatisticsHandler)3 AppProvider (org.eclipse.jetty.deploy.AppProvider)2 PropertiesConfigurationManager (org.eclipse.jetty.deploy.PropertiesConfigurationManager)2 DebugListenerBinding (org.eclipse.jetty.deploy.bindings.DebugListenerBinding)2 WebAppProvider (org.eclipse.jetty.deploy.providers.WebAppProvider)2 MBeanContainer (org.eclipse.jetty.jmx.MBeanContainer)2 RewriteHandler (org.eclipse.jetty.rewrite.handler.RewriteHandler)2 DebugListener (org.eclipse.jetty.server.DebugListener)2 Server (org.eclipse.jetty.server.Server)2 ServerConnector (org.eclipse.jetty.server.ServerConnector)2 DefaultHandler (org.eclipse.jetty.server.handler.DefaultHandler)2 RequestLogHandler (org.eclipse.jetty.server.handler.RequestLogHandler)2 TypeReference (com.fasterxml.jackson.core.type.TypeReference)1 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 ReflectionUtil (com.thoughtworks.go.util.ReflectionUtil)1 SystemEnvironment (com.thoughtworks.go.util.SystemEnvironment)1