Package org.mortbay.jetty.handler

Examples of org.mortbay.jetty.handler.ContextHandlerCollection


      webapp.setBaseResource(resource);
      webapp.setAttribute("persevere.resource", resource);
      webapp.setContextPath(baseURI);
      webapp.setDefaultsDescriptor(persvrHome + sep + "etc" + sep + "webdefault.xml");

      ContextHandlerCollection contexts = new ContextHandlerCollection();
      server.setHandler(contexts);
      contexts.addHandler(webapp);

      server.start();
      String testsDirectory = System.getProperty("persevere.tests");
      if (testsDirectory != null) {
        ((Runnable) webapp.getServletContext().getAttribute("testrunner")).run();
View Full Code Here


        return camelServlet;
    }
   
    protected Server createServer() throws Exception {
        Server server = new Server();
        ContextHandlerCollection collection = new ContextHandlerCollection();
        collection.setServer(server);
        server.addHandler(collection);
        server.start();
        return server;
    }
View Full Code Here

    private Handler createHandler() throws Exception {
        HandlerCollection handlers = new HandlerCollection();

        // handler1
        ContextHandlerCollection contexts = new ContextHandlerCollection();

        contexts.addHandler(createWebAppContext());

        // handler2
        DefaultHandler defaultHandler = new DefaultHandler();

        // handler3
View Full Code Here

        {
            repo.root.mkdirs();
        }

        repo.server = new Server();
        ContextHandlerCollection contexts = new ContextHandlerCollection();
        repo.server.setHandler( contexts );

        SocketConnector connector = new SocketConnector();
        connector.setPort( 0 ); // 0 means, choose and empty port. (we'll find out which, later)

        repo.server.setConnectors( new Connector[] { connector } );

        ContextHandler context = new ContextHandler();
        context.setContextPath( repo.context );
        context.setResourceBase( repo.root.getAbsolutePath() );
        context.setAttribute( "dirAllowed", true );
        context.setAttribute( "maxCacheSize", 0 );
        ServletHandler servlet = new ServletHandler();
        servlet.addServletWithMapping( DefaultServlet.class.getName(), "/" );
        context.setHandler( servlet );
        contexts.addHandler( context );

        repo.server.start();

        int port = connector.getLocalPort();
        repo.url = "http://localhost:" + port + repo.context;
View Full Code Here

        new QueuedThreadPool() : new QueuedThreadPool(maxThreads);
    threadPool.setDaemon(true);
    webServer.setThreadPool(threadPool);

    final String appDir = getWebAppsPath(name);
    ContextHandlerCollection contexts = new ContextHandlerCollection();
    webServer.setHandler(contexts);

    webAppContext = new WebAppContext();
    webAppContext.setDisplayName(name);
    webAppContext.setContextPath("/");
View Full Code Here

                        handlerList.addHandler(h);
                    }
                }
                server.addHandler(handlerList);
            }
            contexts = new ContextHandlerCollection();
            server.addHandler(contexts);
            if (defaultHandler != null) {
                server.addHandler(defaultHandler);
            }
            try {               
View Full Code Here

    QueuedThreadPool threadPool = maxThreads == -1 ?
        new QueuedThreadPool() : new QueuedThreadPool(maxThreads);
    webServer.setThreadPool(threadPool);

    final String appDir = getWebAppsPath(name);
    ContextHandlerCollection contexts = new ContextHandlerCollection();
    webServer.setHandler(contexts);

    webAppContext = new WebAppContext();
    webAppContext.setDisplayName("WepAppsContext");
    webAppContext.setContextPath("/");
View Full Code Here

        this.sslKeystore = sslKeystore;
    }

    protected Server createServer() throws Exception {
        Server server = new Server();
        ContextHandlerCollection collection = new ContextHandlerCollection();
        collection.setServer(server);
        server.addHandler(collection);
        server.start();

        return server;
    }
View Full Code Here

        return camelServlet;
    }
   
    protected Server createServer() throws Exception {
        Server server = new Server();
        ContextHandlerCollection collection = new ContextHandlerCollection();
        collection.setServer(server);
        server.addHandler(collection);
        server.start();
        return server;
    }
View Full Code Here

   
    // Implementation methods
    // -------------------------------------------------------------------------
    protected Server createServer() throws Exception {
        Server server = new Server();
        ContextHandlerCollection collection = new ContextHandlerCollection();
        collection.setServer(server);
        server.addHandler(collection);
        server.start();
        return server;
    }
View Full Code Here

TOP

Related Classes of org.mortbay.jetty.handler.ContextHandlerCollection

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.