Package org.mortbay.jetty.handler

Examples of org.mortbay.jetty.handler.HandlerCollection


                                          String[] configurations,
                                          boolean extract,
                                          boolean java2CompliantClassLoader)
        throws IOException
    {
        HandlerCollection contexts = (HandlerCollection)server.getChildHandlerByClass(ContextHandlerCollection.class);
        if (contexts==null)
            contexts = (HandlerCollection)server.getChildHandlerByClass(HandlerCollection.class);
       
        addWebApplications(contexts,webapps,defaults,configurations,extract,java2CompliantClassLoader);
    }       
View Full Code Here


        WebAppContext webappcontext = new WebAppContext();
        webappcontext.setContextPath("/");

        webappcontext.setWar("webapp");

        HandlerCollection handlers = new HandlerCollection();
        handlers.setHandlers(new Handler[] {webappcontext, new DefaultHandler()});

        server.setHandler(handlers);
        server.start();
        System.out.println("Server ready...");
        server.join();
View Full Code Here

        if (path.endsWith("/")) {
            path = path.substring(0, path.length() - 1);
        }
        String pathSlash = path + "/";
        // Check that context does not exist yet
        HandlerCollection handlerCollection = (HandlerCollection) server.getHandler();
        ContextHandlerCollection contexts = (ContextHandlerCollection) handlerCollection.getHandlers()[0];
        Handler[] handlers = contexts.getHandlers();
        if (handlers != null) {
            for (int i = 0; i < handlers.length; i++) {
                if (handlers[i] instanceof ContextHandler) {
                    ContextHandler h = (ContextHandler) handlers[i];
View Full Code Here

   
    public synchronized void remove(Object context) throws Exception {
        ((ContextHandler) context).stop();
        for (Iterator it = servers.values().iterator(); it.hasNext();) {
            Server server = (Server) it.next();
            HandlerCollection handlerCollection = (HandlerCollection) server.getHandler();
            ContextHandlerCollection contexts = (ContextHandlerCollection) handlerCollection.getHandlers()[0];
            Handler[] handlers = contexts.getHandlers();
            if (handlers != null && handlers.length > 0) {
                contexts.setHandlers((Handler[])LazyList.removeFromArray(handlers, context));
            }
        }
View Full Code Here

        connector.setMaxIdleTime(this.configuration.getConnectorMaxIdleTime());
        Server server = new Server();
        server.setThreadPool(new ThreadPoolWrapper());
        server.setConnectors(new Connector[] { connector });
        ContextHandlerCollection contexts = new ContextHandlerCollection();
        HandlerCollection handlers = new HandlerCollection();
        handlers.setHandlers(new Handler[] { contexts, new DisplayServiceHandler() });
        server.setHandler(handlers);
        server.start();
        servers.put(getKey(url), server);
        sslParams.put(getKey(url), isSsl ? ssl : null);
        if (mbeanContainer != null) {
View Full Code Here

        }
        webappcontext.setContextPath("/");

        webappcontext.setWar(contextPath);

        HandlerCollection handlers = new HandlerCollection();
        handlers.setHandlers(new Handler[] {webappcontext, new DefaultHandler()});

        server.setHandler(handlers);
        try {
            server.start();
                      
View Full Code Here

        mapping.setPathSpec("/*");
        handler.setServletMappings(new ServletMapping[] { mapping });
        context.setHandler(handler);

        ContextHandlerCollection contexts = new ContextHandlerCollection();
        HandlerCollection handlers = new HandlerCollection();
        handlers.setHandlers(new Handler[] { contexts });
        contexts.addHandler(context);

        SelectChannelConnector connector = new SelectChannelConnector();
        connector.setHost("localhost");
        connector.setPort(8190);
View Full Code Here

    RequestLog requestLog = HttpRequestLog.getRequestLog(name);

    if (requestLog != null) {
      RequestLogHandler requestLogHandler = new RequestLogHandler();
      requestLogHandler.setRequestLog(requestLog);
      HandlerCollection handlers = new HandlerCollection();
      handlers.setHandlers(new Handler[] { requestLogHandler, contexts });
      webServer.setHandler(handlers);
    } else {
      webServer.setHandler(contexts);
    }
View Full Code Here

                                          String[] configurations,
                                          boolean extract,
                                          boolean java2CompliantClassLoader)
        throws IOException
    {
        HandlerCollection contexts = (HandlerCollection)server.getChildHandlerByClass(ContextHandlerCollection.class);
        if (contexts==null)
            contexts = (HandlerCollection)server.getChildHandlerByClass(HandlerCollection.class);
       
        addWebApplications(contexts,webapps,defaults,configurations,extract,java2CompliantClassLoader);
    }       
View Full Code Here

          "org.mortbay.jetty.webapp.JettyWebXmlConfiguration",
          "org.mortbay.jetty.webapp.TagLibConfiguration",
          "org.red5.server.jetty.Red5WebPropertiesConfiguration" };

      // Handler collection
      HandlerCollection handlers = new HandlerCollection();
      handlers.setHandlers(new Handler[] {
          new ContextHandlerCollection(), new DefaultHandler() });
      jetty.setHandler(handlers);

      try {
        // Add web applications from web app root with web config
        HandlerCollection contexts = (HandlerCollection) jetty.getChildHandlerByClass(ContextHandlerCollection.class);
        if (contexts == null)
          contexts = (HandlerCollection) jetty.getChildHandlerByClass(HandlerCollection.class);
       
        WebAppDeployer deployer = new WebAppDeployer();
        deployer.setContexts(contexts);
View Full Code Here

TOP

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

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.