Package org.mortbay.jetty.handler

Examples of org.mortbay.jetty.handler.HandlerCollection


        Server server = new Server();
        SelectChannelConnector connector = new SelectChannelConnector();
        connector.setPort(Integer.parseInt(jetty_port));
        server.setConnectors(new Connector[]{connector});
       
        HandlerCollection handlers = new HandlerCollection();
        ContextHandlerCollection contexts = new ContextHandlerCollection();
       
        //TODO: find a way to dynamically get the endpoint url
        WadiCluster wadiCluster = new WadiCluster("CLUSTER", node_name, "http://localhost:"+jetty_port+"/test");
        wadiCluster.doStart();
       
        WadiSessionManager wadiManager = new WadiSessionManager(wadiCluster, 2, 24, 360);
       
        WadiSessionHandler wSessionHandler = new WadiSessionHandler(wadiManager);
        WebAppContext wah = new WebAppContext(null, wSessionHandler, null, null);
        wah.setContextPath("/test");
        wah.setResourceBase(jetty_home+"/webapps/test");
       
        contexts.setHandlers(new Handler[]{wah});
        handlers.setHandlers(new Handler[]{contexts,new DefaultHandler()});
        server.setHandler(handlers);

        HashUserRealm hur = new HashUserRealm();
        hur.setName("Test Realm");
        hur.setConfig(jetty_home+"/etc/realm.properties");
View Full Code Here


        contexts = (ContextHandlerCollection) server
                .getChildHandlerByClass(ContextHandlerCollection.class);
        if (contexts == null)
        {
            contexts = new ContextHandlerCollection();
            HandlerCollection handlers = (HandlerCollection) server
                    .getChildHandlerByClass(HandlerCollection.class);
            if (handlers == null)
            {
                handlers = new HandlerCollection();
                server.setHandler(handlers);
                handlers.setHandlers(new Handler[] { contexts, new DefaultHandler(),
                        requestLogHandler });
            }
            else
            {
                handlers.addHandler(contexts);
            }
        }
    }
View Full Code Here

    {
      checkIfContextIsFree(path);

        JettyHttpContext context = new JettyHttpContext(this, path, handler);
        J2SE6ContextHandler jettyContextHandler = context.getJettyContextHandler();
        HandlerCollection hc = null;
       
        Handler[] handlers = _server.getHandlers();
        for (int i = 0; i < handlers.length; i++)
        {
          if (handlers[i] instanceof HandlerCollection)
          {
            hc = (HandlerCollection) handlers[i];
            break;
          }
    }
        if (hc == null)
          throw new RuntimeException("could not find HandlerCollection, you must configure one");
       
        try
        {
          jettyContextHandler.start();
    }
        catch (Exception ex)
        {
      throw new RuntimeException("could not start created context at path " + jettyContextHandler.getContextPath(), ex);
    }

        hc.addHandler(jettyContextHandler);
        _contexts.put(path, context);
       
        return context;
    }
View Full Code Here

      boolean noServerCleanUp = true;
        if (server == null)
        {
          server = new Server();
         
          HandlerCollection handlerCollection = new HandlerCollection();
          handlerCollection.setHandlers(new Handler[] {new ContextHandlerCollection(), new DefaultHandler()});
      server.setHandler(handlerCollection);
         
          noServerCleanUp = false;
        }
View Full Code Here

        TestSecurityHandler sh = createSecurityHandler();

        PutHandler putHandler = new PutHandler( new File( localRepositoryPath ) );

        HandlerCollection handlers = new HandlerCollection();
        handlers.setHandlers( new Handler[]{ sh, putHandler } );

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

        TestSecurityHandler sh = createSecurityHandler();

        PutHandler putHandler = new PutHandler( new File( localRepositoryPath ) );

        HandlerCollection handlers = new HandlerCollection();
        handlers.setHandlers( addSecurityHandler ? new Handler[]{ sh, putHandler } : new Handler[]{ putHandler } );

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

            e1.printStackTrace();
        }
       
        webappcontext.setWar(warPath);

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

        server.setHandler(handlers);
        try {
            server.start();
                      
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

        }
        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

        }
        webappcontext.setContextPath("/webapp");

        webappcontext.setWar(contextPath);

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

        server.setHandler(handlers);
        try {
            server.start();
                      
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.