Package org.mortbay.jetty.servlet

Examples of org.mortbay.jetty.servlet.SessionHandler


        assert configurationBaseUrl != null;
        assert transactionManager != null;
        assert trackedConnectionAssociator != null;
        assert jettyContainer != null;
       
        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();
        }
        //TODO construct an interceptor chain inside one of the Handlers.
        JettySecurityHandler securityHandler = null;
        if (securityRealmName != null) {
            securityHandler = new JettySecurityHandler();
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() 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

       
        // 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

    /**
     */
    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

                    throw new ServletException(e);
                }
            }
        };

        final SessionHandler sessionHandler = new SessionHandler();
        final SessionManager sessionManager = new HashSessionManager();
        sessionManager.setIdManager(new HashSessionIdManager());
        sessionHandler.setSessionManager(sessionManager);
        sessionHandler.setHandler(handler);

        context.setHandler(sessionHandler);
    }
View Full Code Here

  }
 
  public EmbeddedWebServer(String host, int port) {
    server = new Server();
    handler = new ContextHandlerCollection();
    root = new Context(handler, "/", new SessionHandler(), null, null, null);
   
    if (EMPTY.equals(Monitor.getSystemConfiguration().get(Property.MONITOR_SSL_KEYSTORE))
        || EMPTY.equals(Monitor.getSystemConfiguration().get(Property.MONITOR_SSL_KEYSTOREPASS))
        || EMPTY.equals(Monitor.getSystemConfiguration().get(Property.MONITOR_SSL_TRUSTSTORE))
        || EMPTY.equals(Monitor.getSystemConfiguration().get(Property.MONITOR_SSL_TRUSTSTOREPASS))) {
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 (securityRealmName != null) {
            InternalJAASJettyRealm internalJAASJettyRealm = jettyContainer.addRealm(securityRealmName);
            //wrap jetty realm with something that knows the dumb realmName
View Full Code Here

        SecurityHandler authWrapper = makeAuthWrapper(formAuthenticatrix,
                FORM_AUTH_ROLE, FORM_AUTH_REALM, FORM_AUTH_LOGIN,
                FORM_AUTH_PASSWORD);
        authWrapper.setHandler(handlers);

        SessionHandler sessionHandler = new SessionHandler();
        sessionHandler.setSessionManager(new HashSessionManager());
        sessionHandler.setHandler(authWrapper);
        server.setHandler(sessionHandler);
       
        server.start();
    }
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.