Examples of ContextHandlerCollection


Examples of org.mortbay.jetty.handler.ContextHandlerCollection

        ssl_b_connector.setTruststore(jetty_home+"/etc/keystore");
        ssl_b_connector.setTrustPassword("OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4");
        server.addConnector(ssl_b_connector)
       
        HandlerCollection handlers = new HandlerCollection();
        ContextHandlerCollection contexts = new ContextHandlerCollection();
        RequestLogHandler requestLogHandler = new RequestLogHandler();
        handlers.setHandlers(new Handler[]{contexts,new DefaultHandler(),requestLogHandler});
        server.setHandler(handlers);
       
        ContextDeployer deployer0 = new ContextDeployer();
View Full Code Here

Examples of org.mortbay.jetty.handler.ContextHandlerCollection

    protected void setUp() throws Exception
    {
        server = new Server(0);
            
        HandlerCollection handlers = new HandlerCollection();
        ContextHandlerCollection contexts = new ContextHandlerCollection();
        RequestLogHandler requestLogHandler = new RequestLogHandler();
        handlers.setHandlers(new Handler[]{contexts,new DefaultHandler(),requestLogHandler});
        server.setHandler(handlers);
       
        test0 = new WebAppContext(contexts,"../../webapps/test","/test0");
View Full Code Here

Examples of org.mortbay.jetty.handler.ContextHandlerCollection

       
        try{
           
            // Create the server
            Server server = new Server();
            ContextHandlerCollection contexts = new ContextHandlerCollection();
            server.setHandler(contexts);
           
            SocketConnector connector = new SocketConnector();
            String address = args[0];
            int colon = address.lastIndexOf(':');
            if (colon<0)
                connector.setPort(Integer.parseInt(address));
            else
            {
                connector.setHost(address.substring(0,colon));
                connector.setPort(Integer.parseInt(address.substring(colon+1)));
            }
            server.setConnectors(new Connector[]{connector});
           
            if (args.length<3)
            {
                ContextHandler context = new ContextHandler();
                context.setContextPath(URIUtil.SLASH);
                context.setResourceBase(args.length==1?".":args[1]);
                ServletHandler servlet = new ServletHandler();
                servlet.addServletWithMapping("org.mortbay.jetty.servlet.DefaultServlet", URIUtil.SLASH);
                context.setHandler(servlet);
                contexts.addHandler(context);
            }
            else if ("-webapps".equals(args[1]))
            {
                WebAppContext.addWebApplications(server, args[2], WebAppContext.WEB_DEFAULTS_XML, true, true);
            }
            else if ("-webapp".equals(args[1]))
            {
                WebAppContext webapp = new WebAppContext();
                webapp.setWar(args[2]);
                webapp.setContextPath(URIUtil.SLASH);
                contexts.addHandler(webapp);
            }
               
            server.start();
           
        }
View Full Code Here

Examples of org.mortbay.jetty.handler.ContextHandlerCollection

        if (_sessionIdMgr == null || _sessionMgr1 == null || _sessionMgr2 == null)
            throw new IllegalStateException ("Must set a SessionIdManager instance and 2 SessionManager instances");

        setSessionIdManager(_sessionIdMgr);
        //set up 2 contexts and a filter than can forward between them
        ContextHandlerCollection contextsA = new ContextHandlerCollection();
        setHandler(contextsA);
        setSessionIdManager(_sessionIdMgr);

        Context contextA1 = new Context(contextsA,"/contextA",Context.SESSIONS);
        contextA1.addServlet(new ServletHolder(new SessionActionServlet()), "/session/*");
 
View Full Code Here

Examples of org.mortbay.jetty.handler.ContextHandlerCollection

            this.requestLogHandler.setRequestLog(this.requestLog);
       
        this.contexts = (ContextHandlerCollection)server.getChildHandlerByClass(ContextHandlerCollection.class);
        if (this.contexts==null)
        {  
            this.contexts = new ContextHandlerCollection();
            this.handlers = (HandlerCollection)server.getChildHandlerByClass(HandlerCollection.class);
            if (this.handlers==null)
            {
                this.handlers = new HandlerCollection();              
                this.server.setHandler(handlers);                           
View Full Code Here

Examples of org.mortbay.jetty.handler.ContextHandlerCollection

    public JettyHttpServer()
    {
        _server = new Server();
        HandlerCollection handlerCollection = new HandlerCollection();
        _contextCollection = new ContextHandlerCollection();
        handlerCollection.setHandlers(new Handler[] {_contextCollection, new DefaultHandler()});
        _server.setHandler(handlerCollection);
    }
View Full Code Here

Examples of org.mortbay.jetty.handler.ContextHandlerCollection

    this("0.0.0.0", 0);
  }
 
  public EmbeddedWebServer(String host, int port) {
    server = new Server();
    handler = new ContextHandlerCollection();
    root = new Context(handler, "/", new SessionHandler(), null, null, null);
   
    if (EMPTY.equals(Monitor.getSystemConfiguration().get(Property.MONITOR_SSL_KEYSTORE))
        || EMPTY.equals(Monitor.getSystemConfiguration().get(Property.MONITOR_SSL_KEYSTOREPASS))
        || EMPTY.equals(Monitor.getSystemConfiguration().get(Property.MONITOR_SSL_TRUSTSTORE))
View Full Code Here

Examples of org.mortbay.jetty.handler.ContextHandlerCollection

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

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

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

Examples of org.mortbay.jetty.handler.ContextHandlerCollection

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

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

    webAppContext = new WebAppContext();
    webAppContext.setDisplayName(name);
    webAppContext.setContextPath("/");
    webAppContext.setResourceBase(appDir + "/" + name);
    webAppContext.setDescriptor(appDir + "/" + name + "/WEB-INF/web.xml");

    contexts.addHandler(webAppContext);
    webServer.setHandler(contexts);

    addDefaultApps(contexts, appDir, conf);
  }
View Full Code Here

Examples of org.mortbay.jetty.handler.ContextHandlerCollection

      AbstractSessionManager asm = (AbstractSessionManager)sm;
      asm.setHttpOnly(true);
      asm.setSecureCookies(true);
    }

    ContextHandlerCollection contexts = new ContextHandlerCollection();
    RequestLog requestLog = HttpRequestLog.getRequestLog(name);

    if (requestLog != null) {
      RequestLogHandler requestLogHandler = new RequestLogHandler();
      requestLogHandler.setRequestLog(requestLog);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.