Package io.undertow.servlet.spec

Examples of io.undertow.servlet.spec.HttpSessionImpl


        //we have some old data
        PersistentSession result = data.remove(incomingSessionId);
        if (result != null) {
            long time = System.currentTimeMillis();
            if (time < result.getExpiration().getTime()) {
                final HttpSessionImpl session = servletContext.getSession(exchange, true);
                final HttpSessionEvent event = new HttpSessionEvent(session);
                for (Map.Entry<String, Object> entry : result.getSessionData().entrySet()) {

                    if (entry.getValue() instanceof HttpSessionActivationListener) {
                        ((HttpSessionActivationListener) entry.getValue()).sessionWillPassivate(event);
                    }
                    session.setAttribute(entry.getKey(), entry.getValue());
                }
            }
        }
        next.handleRequest(exchange);
    }
View Full Code Here


                        }
                        headers.putAll(entry.getHeaderName(), entry);
                    }
                    SavedRequest request = new SavedRequest(buffer, read, exchange.getRequestMethod(), exchange.getRequestURI(), exchange.getRequestHeaders());
                    final ServletRequestContext sc = exchange.getAttachment(ServletRequestContext.ATTACHMENT_KEY);
                    HttpSessionImpl session = sc.getCurrentServletContext().getSession(exchange, true);
                    Session underlyingSession;
                    if(System.getSecurityManager() == null) {
                        underlyingSession = session.getSession();
                    } else {
                        underlyingSession = AccessController.doPrivileged(new HttpSessionImpl.UnwrapSessionAction(session));
                    }
                    underlyingSession.setAttribute(SESSION_KEY, request);
                } catch (IOException e) {
View Full Code Here

    }

    @Override
    protected Session getSession(HttpServerExchange exchange) {
        ServletRequestContext servletRequestContext = exchange.getAttachment(ServletRequestContext.ATTACHMENT_KEY);
        final HttpSessionImpl session = servletRequestContext.getCurrentServletContext().getSession(exchange, true);
        if(System.getSecurityManager() == null) {
            return session.getSession();
        } else {
            return AccessController.doPrivileged(new HttpSessionImpl.UnwrapSessionAction(session));
        }
    }
View Full Code Here

TOP

Related Classes of io.undertow.servlet.spec.HttpSessionImpl

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.