Package org.mortbay.jetty.servlet

Examples of org.mortbay.jetty.servlet.SessionHandler


        String contextPath = "/lightLoad";
        String servletMapping = "/server";
        int port1 = random.nextInt(50000) + 10000;
        Server server1 = new Server(port1);
        WebAppContext context1 = new WebAppContext(warDir.getCanonicalPath(), contextPath);
        context1.setSessionHandler(new SessionHandler());
        context1.addServlet(TestServlet.class, servletMapping);
        server1.setHandler(context1);
        server1.start();
        try
        {
            int port2 = random.nextInt(50000) + 10000;
            Server server2 = new Server(port2);
            WebAppContext context2 = new WebAppContext(warDir.getCanonicalPath(), contextPath);
            context2.setSessionHandler(new SessionHandler());
            context2.addServlet(TestServlet.class, servletMapping);
            server2.setHandler(context2);
            server2.start();
            try
            {
View Full Code Here


        TerracottaSessionManager sessionManager = new TerracottaSessionManager();
        sessionManager.setIdManager(sessionIdManager);
        sessionManager.setMaxInactiveInterval(maxInactivePeriod);
        sessionManager.setScavengePeriodMs(TimeUnit.SECONDS.toMillis(scavengePeriod));

        SessionHandler sessionHandler = new TerracottaSessionHandler(sessionManager);
        sessionManager.setSessionHandler(sessionHandler);
        context.setSessionHandler(sessionHandler);

        return context;
    }
View Full Code Here

        String contextPath = "/migration";
        String servletMapping = "/server";
        int port1 = random.nextInt(50000) + 10000;
        Server server1 = new Server(port1);
        WebAppContext context1 = new WebAppContext(warDir.getCanonicalPath(), contextPath);
        context1.setSessionHandler(new SessionHandler());
        context1.addServlet(TestServlet.class, servletMapping);
        server1.setHandler(context1);
        server1.start();
        try
        {
            int port2 = random.nextInt(50000) + 10000;
            Server server2 = new Server(port2);
            WebAppContext context2 = new WebAppContext(warDir.getCanonicalPath(), contextPath);
            context2.setSessionHandler(new SessionHandler());
            context2.addServlet(TestServlet.class, servletMapping);
            server2.setHandler(context2);
            server2.start();
            try
            {
View Full Code Here

       
        // bind the jetty http handler with the context handler       
        context.setHandler(handler);
        if (isSessionSupport) {           
            HashSessionManager sessionManager = new HashSessionManager();
            SessionHandler sessionHandler = new SessionHandler(sessionManager);
            HashSessionIdManager idManager = new HashSessionIdManager();
            sessionManager.setIdManager(idManager);           
            context.addHandler(sessionHandler);          
        }
        contexts.addHandler(context);
View Full Code Here

        addResourcesAndWelcomeFiles(handlers);

        final ServletHandler servletHandler = new ServletHandler();
        addServletsAndFilters(servletHandler);

        final SessionHandler sessionHandler = new SessionHandler();
        sessionHandler.setHandler(servletHandler);
        handlers.addHandler(sessionHandler);

        // commenting out; this grabs '/' but we might want to use it ourselves,
        // instead?
        // handlers.addHandler(new DefaultHandler());
View Full Code Here

        addResourcesAndWelcomeFiles(handlers);

        final ServletHandler servletHandler = new ServletHandler();
        addServletsAndFilters(servletHandler);

        final SessionHandler sessionHandler = new SessionHandler();
        sessionHandler.setHandler(servletHandler);
        handlers.addHandler(sessionHandler);

        // commenting out; this grabs '/' but we might want to use it ourselves, instead?
        // handlers.addHandler(new DefaultHandler());
View Full Code Here

    }

    public class MockSessionHandlerFactory implements SessionHandlerFactory {
        public SessionHandler createHandler(PreHandler preHandler) {
            return new SessionHandler();
        }
View Full Code Here

       
        // bind the jetty http handler with the context handler       
        context.setHandler(handler);
        if (isSessionSupport) {           
            HashSessionManager sessionManager = new HashSessionManager();
            SessionHandler sessionHandler = new SessionHandler(sessionManager);
            HashSessionIdManager idManager = new HashSessionIdManager();
            sessionManager.setIdManager(idManager);           
            context.addHandler(sessionHandler);          
        }
        contexts.addHandler(context);
View Full Code Here

    }

    private void enableSessionSupport(Server server) throws Exception {
        Context context = (Context)server.getChildHandlerByClass(Context.class);
        if (context.getSessionHandler() == null) {
            SessionHandler sessionHandler = new SessionHandler();
            context.setSessionHandler(sessionHandler);
            if (context.isStarted()) {
                // restart the context
                context.stop();
                context.start();
View Full Code Here

    context.setContextPath("/");
    context.setResourceBase(RES_DIR);
    ServletHandler sh = new ServletHandler();
    sh.addServlet("org.apache.jasper.servlet.JspServlet", "*.jsp");
    context.addHandler(sh);
    context.addHandler(new SessionHandler());

    server = new Server();
    server.addHandler(context);

    conf = new Configuration();
View Full Code Here

TOP

Related Classes of org.mortbay.jetty.servlet.SessionHandler

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.