Package org.apache.catalina

Examples of org.apache.catalina.Session


            if (context == null)
                return (false);
            Manager manager = context.getManager();
            if (manager == null)
                return (false);
            Session session = null;
            try {
                session = manager.findSession(requestedSessionId);
            } catch (IOException e) {
                session = null;
            }
            if ((session != null) && session.isValid()) {
                return (true);
            } else {
                return (false);
            }
View Full Code Here


        if (location.startsWith("#"))
            return (false);

        // Are we in a valid session that is not using cookies?
        final Request hreq = request;
        final Session session = hreq.getSessionInternal(false);
        if (session == null)
            return (false);
        if (hreq.isRequestedSessionIdFromCookie())
            return (false);
       
View Full Code Here

        recordCreateUnderlyingSession();
       
        startVerification();

        ClusteredManager manager = newManager();
        Session createdSession = manager.createSession(null);
        assertTrue(createdSession.isValid());

        HttpSession httpSession = createdSession.getSession();
        assertEquals("value", httpSession.getAttribute("key"));
        assertTrue(httpSession.isNew());
       
        assertSame(createdSession, manager.findSession(sessionId));
    }
View Full Code Here

       
        ClusteredManager manager = newManager();
       
        sessionListener.notifyInboundSessionMigration(underlyingSession);
       
        Session foundSession = manager.findSession(sessionId);
        assertNotNull(foundSession);

        assertTrue(foundSession.isValid());

        HttpSession httpSession = foundSession.getSession();
        assertEquals("value", httpSession.getAttribute("key"));
        assertFalse(httpSession.isNew());
    }
View Full Code Here

        underlyingSession.release();
       
        startVerification();

        ClusteredManager manager = newManager();
        Session session = manager.createSession(null);
        HttpSession httpSession = session.getSession();
        httpSession.invalidate();
    }
View Full Code Here

        underlyingSession.onEndAccess();
       
        startVerification();
       
        ClusteredManager manager = newManager();
        Session session = manager.createSession(null);
        session.endAccess();
    }
View Full Code Here

        started = false;

        // Expire all active sessions
        if (log.isInfoEnabled())
            log.info(sm.getString("deltaManager.expireSessions", getName()));
        Session sessions[] = findSessions();
        for (int i = 0; i < sessions.length; i++) {
            DeltaSession session = (DeltaSession) sessions[i];
            if (!session.isValid())
                continue;
            try {
View Full Code Here

     * Exipre all find sessions.
     */
    public void expireAllLocalSessions()
    {
        long timeNow = System.currentTimeMillis();
        Session sessions[] = findSessions();
        int expireDirect  = 0 ;
        int expireIndirect = 0 ;
       
        if(log.isDebugEnabled())
            log.debug("Start expire all sessions " + getName() + " at " + timeNow + " sessioncount " + sessions.length);
View Full Code Here

    protected void sendCrossContextSession(CatalinaCluster containerCluster) {
        Object sessions = crossContextSessions.get();
        if(sessions != null && sessions instanceof List
                && ((List)sessions).size() >0) {
            for(Iterator iter = ((List)sessions).iterator(); iter.hasNext() ;) {         
                Session session = (Session)iter.next();
                if(log.isDebugEnabled())
                    log.debug(sm.getString("ReplicationValve.crossContext.sendDelta"
                            session.getManager().getContainer().getName() ));
                sendMessage(session,(ClusterManager)session.getManager(),containerCluster);
                if(isDoProcessingStats()) {
                    nrOfCrossContextSendRequests++;
                }
            }
        }
View Full Code Here

     * Fix memory leak for long sessions with many changes, when no backup member exists!
     * @param request current request after responce is generated
     * @param isCrossContext check crosscontext threadlocal
     */
    protected void resetReplicationRequest(Request request, boolean isCrossContext) {
        Session contextSession = request.getSessionInternal(false);
        if(contextSession != null & contextSession instanceof DeltaSession){
            resetDeltaRequest(contextSession);
        }
        if(isCrossContext) {
            Object sessions = crossContextSessions.get();
            if(sessions != null && sessions instanceof List
               && ((List)sessions).size() >0) {
                Iterator iter = ((List)sessions).iterator();
                for(; iter.hasNext() ;) {         
                    Session session = (Session)iter.next();
                    resetDeltaRequest(session);
                }
            }
        }                    
    }
View Full Code Here

TOP

Related Classes of org.apache.catalina.Session

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.