Package org.eclipse.jetty.server.handler

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


      sh.setInitParameter("com.sun.jersey.api.json.POJOMappingFeature",
          "true");
      root.addServlet(sh, "/api/v1/*");
      sh.setInitOrder(2);

      HandlerList handlerList = new HandlerList();

      for (ViewInstanceDefinition viewInstanceDefinition : ViewRegistry.readViewArchives(configs)){
        handlerList.addHandler(ViewRegistry.getWebAppContext(viewInstanceDefinition));
      }
      handlerList.addHandler(root);

      server.setHandler(handlerList);

      ServletHolder agent = new ServletHolder(ServletContainer.class);
      agent.setInitParameter("com.sun.jersey.config.property.resourceConfigClass",
View Full Code Here


   }

   private HandlerList constructHandlers() {

      final JettyContext jettyContext = new JettyContext(currentHost, currentStubsPort, currentStubsSslPort, currentAdminPort);
      final HandlerList handlers = new HandlerList();
      handlers.setHandlers(new Handler[]
            {
                  constructHandler(STUBS_CONNECTOR_NAME, "/", staticResourceHandler("ui/html/templates/", "default404.html")),
                  constructHandler(STUBS_CONNECTOR_NAME, "/", staticResourceHandler("ui/images/", "favicon.ico")),
                  constructHandler(STUBS_CONNECTOR_NAME, "/", new StubsHandler(dataStore)),
View Full Code Here

   }

   private HandlerList constructHandlers() {

      final JettyContext jettyContext = new JettyContext(currentHost, currentStubsPort, currentStubsSslPort, currentAdminPort);
      final HandlerList handlers = new HandlerList();
      handlers.setHandlers(new Handler[]
            {
                  constructHandler(STUBS_CONNECTOR_NAME, "/", new StubsHandler(dataStore)),
                  constructHandler(SSL_CONNECTOR_NAME, "/", new StubsHandler(dataStore)),

                  constructHandler(ADMIN_CONNECTOR_NAME, "/stubdata/new", new StubsRegistrationHandler(dataStore, yamlParser)),
View Full Code Here

        super(logging);
    }

    @Override
    protected void startJetty() {
        HandlerList handlerList;
        ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS);
        context.setContextPath("/graphaware");
        context.addLifeCycleListener(new JettyStartingListener(context.getServletContext()));

        //If http logging is turned on, the jetty handler is a RequestLogHandler with a different type hierarchy than
        //the HandlerList returned when http logging is off
        if(getJetty().getHandler().getClass().equals(RequestLogHandler.class)) {
            handlerList = (HandlerList)((RequestLogHandler)getJetty().getHandler()).getHandler();
        }
        else {
            handlerList = (HandlerList) getJetty().getHandler();
        }
        handlerList.setHandlers(ArrayUtil.prependToArray(context, handlerList.getHandlers(), Handler.class));

        super.startJetty();
    }
View Full Code Here

        RedirectPatternRule redirect = new RedirectPatternRule();
        redirect.setPattern("/templeton/v1/application.wadl");
        redirect.setLocation("/templeton/application.wadl");
        rewrite.addRule(redirect);

        HandlerList handlerlist = new HandlerList();
        ArrayList<Handler> handlers = new ArrayList<Handler>();

        // Any redirect handlers need to be added first
        handlers.add(rewrite);

        // Now add all the default handlers
        for (Handler handler : server.getHandlers()) {
            handlers.add(handler);
        }
        Handler[] newlist = new Handler[handlers.size()];
        handlerlist.setHandlers(handlers.toArray(newlist));
        server.setHandler(handlerlist);
    }
View Full Code Here

    webappcontext.addServlet(new ServletHolder(new WebInterfaceDependencyServlet(masterInfo)),
        "/dependency");
    webappcontext.addServlet(new ServletHolder(new WebInterfaceDownloadServlet(masterInfo)),
        "/download");

    HandlerList handlers = new HandlerList();
    handlers.setHandlers(new Handler[] {webappcontext, new DefaultHandler()});
    mServer.setHandler(handlers);
  }
View Full Code Here

   }

   private HandlerList constructHandlers() {

      final JettyContext jettyContext = new JettyContext(currentHost, isSsl, currentStubsPort, currentAdminPort);
      final HandlerList handlers = new HandlerList();
      handlers.setHandlers(new Handler[]
            {
                  constructHandler(STUBS_CONNECTOR_NAME, "/", new StubsHandler(dataStore)),
                  constructHandler(SSL_CONNECTOR_NAME, "/", new SslHandler(dataStore)),

                  constructHandler(ADMIN_CONNECTOR_NAME, "/stubdata/new", new StubsRegistrationHandler(dataStore, yamlParser)),
View Full Code Here

    ResourceHandler resourceHandler = new ResourceHandler();
    resourceHandler.setDirectoriesListed(false);
    resourceHandler.setResourceBase(webDir.getAbsolutePath());

    // ----- add the handlers to the list handler -----
    HandlerList handlers = new HandlerList();
    handlers.addHandler(servletContext);
    handlers.addHandler(resourceHandler);

    // ----- create the login module with http authentication -----

    File af = null;
    String authFile = nepheleConfig.getString(ConfigConstants.JOB_MANAGER_WEB_ACCESS_FILE_KEY, null);
View Full Code Here

    ResourceHandler resourceHandler = new ResourceHandler();
    resourceHandler.setDirectoriesListed(false);
    resourceHandler.setResourceBase(webDir.getAbsolutePath());

    // ----- add the handlers to the list handler -----
    HandlerList handlers = new HandlerList();
    handlers.addHandler(servletContext);
    handlers.addHandler(pactPlanContext);
    handlers.addHandler(resourceHandler);

    // ----- create the login module with http authentication -----

    File af = null;
    String authFile = config.getString(ConfigConstants.WEB_ACCESS_FILE_KEY,
View Full Code Here

            configContext.setBaseResource(getBaseResource());
            configContext.setClassLoader(Thread.currentThread().getContextClassLoader());
            configContext.setHandler(new ConfigHandler());
            configContext.setInitParameter("cacheControl", "max-age=0, public");

            HandlerList handlers = new HandlerList();
            handlers.setHandlers(new Handler[] {configContext, sendGcodeContext, adjustManualLocationContext, getSystemStateContext, resourceHandler, new DefaultHandler()});

            server.setHandler(handlers);

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

TOP

Related Classes of org.eclipse.jetty.server.handler.HandlerList

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.