Examples of ContextHandlerCollection


Examples of org.eclipse.jetty.server.handler.ContextHandlerCollection

        connector.setSoLingerTime(-1);
        connector.setPort(8080);
        server.setConnectors(new Connector[]{connector});

        WebAppContext webapp = new WebAppContext("src/main/webapp", "/");
        HandlerCollection contexts = new ContextHandlerCollection();
        contexts.addHandler(webapp);
        contexts.addHandler(new DefaultHandler());
        server.setHandler(contexts);

        try {
            System.out.println(">>> STARTING EMBEDDED JETTY SERVER, PRESS ANY KEY TO STOP");
            server.start();
View Full Code Here

Examples of org.eclipse.jetty.server.handler.ContextHandlerCollection

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

Examples of org.eclipse.jetty.server.handler.ContextHandlerCollection

  {
    server = new Server( port );   
    server.setStopAtShutdown( true );
   
    // Initialize the servlets
    ContextHandlerCollection contexts = new ContextHandlerCollection();
    server.setHandler(contexts);
    WebAppContext lcfCrawlerUI = new WebAppContext(crawlerWarPath,"/mcf-crawler-ui");
    // This can cause jetty to ignore all of the framework and jdbc jars in the war, which is what we
    // want in the single-process case.
    lcfCrawlerUI.setParentLoaderPriority(useParentLoader);
    contexts.addHandler(lcfCrawlerUI);
    WebAppContext lcfAuthorityService = new WebAppContext(authorityServiceWarPath,"/mcf-authority-service");
    // This can cause jetty to ignore all of the framework and jdbc jars in the war, which is what we
    // want in the single-process case.
    lcfAuthorityService.setParentLoaderPriority(useParentLoader);
    contexts.addHandler(lcfAuthorityService);
    WebAppContext lcfApi = new WebAppContext(apiWarPath,"/mcf-api-service");
    // This can cause jetty to ignore all of the framework and jdbc jars in the war, which is what we
    // want in the single-process case.
    lcfApi.setParentLoaderPriority(useParentLoader);
    contexts.addHandler(lcfApi);
  }
View Full Code Here

Examples of org.eclipse.jetty.server.handler.ContextHandlerCollection

                            handlerCollection.addHandler(h);
                        }
                    }
                }
            }
            contexts = new ContextHandlerCollection();
            /*
             * handlerCollection may be null here if is only one handler to deal with.
             * Which in turn implies that there can't be a 'defaultHander' to deal with.
             */
            if (handlerCollection != null) {
View Full Code Here

Examples of org.eclipse.jetty.server.handler.ContextHandlerCollection

    SelectChannelConnector connector = new SelectChannelConnector();
    connector.setPort(8080);
    server.addConnector(connector);
    ContextHandler updateContext = createUpdateContext();
    ContextHandler rootContext = createRootContext();
    ContextHandlerCollection handlers = new ContextHandlerCollection();
    handlers.setHandlers(new Handler[]{updateContext, rootContext});
    server.setHandler(handlers);
    server.start();
  }
View Full Code Here

Examples of org.eclipse.jetty.server.handler.ContextHandlerCollection

            this.server.setSendDateHeader(true);
            this.server.setSendServerVersion(this.config.isSendServerHeader());

            this.server.addBean(new HashLoginService("OSGi HTTP Service Realm"));

            this.parent = new ContextHandlerCollection();

            ServletContextHandler context = new ServletContextHandler(this.parent, this.config.getContextPath(), ServletContextHandler.SESSIONS);

            configureSessionManager(context);
            context.addEventListener(eventDispatcher);
View Full Code Here

Examples of org.eclipse.jetty.server.handler.ContextHandlerCollection

       
    }
   
    protected Server createServer() throws Exception {
        Server server = new Server();
        ContextHandlerCollection collection = new ContextHandlerCollection();
        server.setHandler(collection);

        // configure thread pool if min/max given
        if (minThreads != null || maxThreads != null) {
            if (getThreadPool() != null) {
View Full Code Here

Examples of org.eclipse.jetty.server.handler.ContextHandlerCollection

        webAppContext.setContextPath(this.getContextPath());
        webAppContext.setWar(this.getWebAppDir());
        webAppContext.getSessionHandler().getSessionManager().setMaxInactiveInterval(super.getSessionTimeout() * 60);
        LOGGER.info("getMaxInactiveInterval() is %d seconds", webAppContext.getSessionHandler().getSessionManager().getMaxInactiveInterval());

        ContextHandlerCollection contexts = new ContextHandlerCollection();
        contexts.setHandlers(new Handler[]{webAppContext});

        server = new org.eclipse.jetty.server.Server();
        server.setConnectors(new Connector[]{httpConnector, httpsConnector});
        server.setHandler(contexts);

View Full Code Here

Examples of org.eclipse.jetty.server.handler.ContextHandlerCollection

      }

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

    ContextHandlerCollection contexts = new ContextHandlerCollection();

    {
      ServletContextHandler context = new ServletContextHandler(contexts, "/api");
      // context.setContextPath("/");
      context.addEventListener(guiceServletConfig);

      // Must add DefaultServlet for embedded Jetty
      // Failing to do this will cause 404 errors.
      context.addServlet(DefaultServlet.class, "/");

      FilterHolder filterHolder = new FilterHolder(GuiceFilter.class);
      context.addFilter(filterHolder, "*", EnumSet.of(DispatcherType.REQUEST));

      context.setClassLoader(Thread.currentThread().getContextClassLoader());
    }

    for (Entry<String, File> entry : wars.entrySet()) {
      String contextPath = entry.getKey();
      File war = entry.getValue();

      WebAppContext context = new WebAppContext();
      context.setWar(war.getAbsolutePath());
      context.setContextPath(contextPath);

      context.setInitParameter("org.eclipse.jetty.servlet.Default.dirAllowed", "false");

      context.addFilter(GwtCacheHeaderFilter.class, "/*", EnumSet.of(DispatcherType.REQUEST));

      contexts.addHandler(context);
    }

    server.setHandler(contexts);

    server.addLifeCycleListener(new CloseOnFailLifecycleListener());
View Full Code Here

Examples of org.eclipse.jetty.server.handler.ContextHandlerCollection

    if (System.getProperty("alfrescoServerWarPath") != null)
      alfrescoServerWarPath = System.getProperty("alfrescoServerWarPath");
   
    //Initialize Alfresco Server bindings
    ContextHandlerCollection contexts = new ContextHandlerCollection();
    alfrescoServer.setHandler(contexts);

    WebAppContext alfrescoServerApi = new WebAppContext(alfrescoServerWarPath,"/alfresco");
    alfrescoServerApi.setParentLoaderPriority(false);
    HashLoginService dummyLoginService = new HashLoginService("TEST-SECURITY-REALM");
    alfrescoServerApi.getSecurityHandler().setLoginService(dummyLoginService);
    contexts.addHandler(alfrescoServerApi);
   
    Class h2DataSource = Thread.currentThread().getContextClassLoader().loadClass("org.h2.jdbcx.JdbcDataSource");
    Object o = h2DataSource.newInstance();
    String jdbcUrl = "jdbc:h2:.alf_data_jetty/h2_data/alf_jetty";
    String jdbcUsername = "alfresco";
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.