Package org.mortbay.jetty.servlet

Examples of org.mortbay.jetty.servlet.SessionHandler


        assert trackedConnectionAssociator != null;
        assert jettyContainer != null;

        this.holder = holder == null ? Holder.EMPTY : holder;

        SessionHandler sessionHandler;
        if (null != handlerFactory) {
            if (null == preHandlerFactory) {
                throw new IllegalStateException("A preHandlerFactory must be set if an handler factory is set.");
            }
            PreHandler preHandler = preHandlerFactory.createHandler();
            sessionHandler = handlerFactory.createHandler(preHandler);
        } else {
            sessionHandler = new SessionHandler();
        }
        JettySecurityHandler securityHandler = null;
        if (securityRealmName != null) {
            securityHandler = new JettySecurityHandler();
            InternalJAASJettyRealm internalJAASJettyRealm = jettyContainer.addRealm(securityRealmName);
View Full Code Here


    /**
     */
    public WebAppContext(SecurityHandler securityHandler,SessionHandler sessionHandler, ServletHandler servletHandler, ErrorHandler errorHandler)
    {
        super(null,
              sessionHandler!=null?sessionHandler:new SessionHandler(),
              securityHandler!=null?securityHandler:new SecurityHandler(),
              servletHandler!=null?servletHandler:new ServletHandler(),
              null);
       
        setErrorHandler(errorHandler!=null?errorHandler:new ErrorPageErrorHandler());
View Full Code Here

    }

    private void enableSessionSupport() throws Exception {
        Context context = (Context)getServer().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

        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

                ContextHandler contextHandler = new ContextHandler();
                //contextHandler.setContextPath(contextPath);
                contextHandler.setContextPath("/");
                server.setHandler(contextHandler);
   
                SessionHandler sessionHandler = new SessionHandler();
                ServletHandler servletHandler = new ServletHandler();
                sessionHandler.addHandler(servletHandler);
   
                contextHandler.setHandler(sessionHandler);
   
                server.setStopAtShutdown(true);
                server.setSendServerVersion(sendServerVersion);
View Full Code Here

    }

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

        this.holder = holder == null ? Holder.EMPTY : holder;

        this.runAsSource = runAsSource == null? RunAsSource.NULL: runAsSource;

        SessionHandler sessionHandler;
        if (null != handlerFactory) {
            if (null == preHandlerFactory) {
                throw new IllegalStateException("A preHandlerFactory must be set if an handler factory is set.");
            }
            PreHandler preHandler = preHandlerFactory.createHandler();
            sessionHandler = handlerFactory.createHandler(preHandler);
        } else {
            sessionHandler = new SessionHandler();
        }
        JettySecurityHandler securityHandler = null;
        if (configurationFactory != null) {
            InternalJAASJettyRealm internalJAASJettyRealm = new InternalJAASJettyRealm(configurationFactory);
            //wrap jetty realm with something that knows the dumb realmName
View Full Code Here

        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

     * @throws Exception
     */
    public JBossWebAppContext(WebDescriptorParser descriptorParser,WebApplication webApp, String warUrl)
    throws Exception
    {
        super(null,new SessionHandler(), new Jsr77ServletHandler(), null);
        setWar(warUrl);
        ((Jsr77ServletHandler)getServletHandler()).setWebAppContext(this);
        _descriptorParser=descriptorParser;
        _webApp=webApp;
        //very important - establish the classloader now, as it is the one
View Full Code Here

        TerracottaSessionManager sessionManager = new TestTerracottaSessionManager();
        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

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.