Examples of DistSession


Examples of org.apache.jcs.utils.servlet.session.DistSession

    {
        //not really a pool but a factory.  needs to be changed
        // theres no way to get it back int the pool
        //DistSession sess = ds.Mgr.getDistSession()
        String session_id = null;
        DistSession sess = new DistSession();
        try
        {
            // create a cookie that corrsponds to a session value in the svo
            sess.initNew();
//      sess.initNew(req.getServerName());
            session_id = sess.getId();
            Cookie c = new Cookie( SESSION_COOKIE_NAME, session_id );
            c.setPath( "/" );
            c.setMaxAge( -1 );
            res.addCookie( c );
            if ( log.isInfoEnabled() )
View Full Code Here

Examples of org.apache.jcs.utils.servlet.session.DistSession

     * @return The distSession value
     */
    private MetaHttpSession getDistSession( HttpServletRequest req )
    {
        log.info( "in getSession" );
        DistSession sess = null;
        String session_id = getRequestedSessionId( req );

        if ( session_id == null )
        {
            log.info( "no cookie found" );
            return new MetaHttpSession( null, null );
        }
        sess = new DistSession();

        if ( !sess.init( session_id ) )
        {
            return new MetaHttpSession( session_id, null );
        }
        long idleTime = System.currentTimeMillis() - sess.getLastAccessedTime();
        int max = sess.getMaxInactiveInterval();
        if ( idleTime > max / 2 )
        {
            if ( idleTime < max )
            {
                sess.access();
            }
            else
            {
                sessIdSet.remove( session_id );
                sess.invalidate();
                return new MetaHttpSession( session_id, null );
            }
        }
        return new MetaHttpSession( session_id, sess );
    }
View Full Code Here

Examples of org.apache.jcs.utils.servlet.session.DistSession


    /** Gets the requestedSessionIdValid attribute of the DistSessionTracker object */
    public boolean isRequestedSessionIdValid( HttpServletRequest req )
    {
        DistSession sess = new DistSession();
        return sess.init( getRequestedSessionId( req ) );
    }
View Full Code Here

Examples of org.apache.jcs.utils.servlet.session.DistSession

                log.debug( "garbage collecting..." );
            }
            for ( int i = 0; i < sessIds.length; i++ )
            {
                String session_id = sessIds[i];
                DistSession sess = new DistSession();
                if ( !sess.init( session_id ) )
                {
                    continue;
                }
                long idleTime = System.currentTimeMillis() - sess.getLastAccessedTime();
                int max = sess.getMaxInactiveInterval();
                if ( idleTime >= max )
                {
                    sessIdSet.remove( session_id );
                    sess.invalidate();
                    continue;
                }
            }
            // end for loop.
        } while ( true );
View Full Code Here

Examples of org.apache.stratum.jcs.utils.servlet.session.DistSession

                log.debug( "garbage collecting..." );
            }
            for ( int i = 0; i < sessIds.length; i++ )
            {
                String session_id = sessIds[i];
                DistSession sess = new DistSession();
                if ( !sess.init( session_id ) )
                {
                    continue;
                }
                long idleTime = System.currentTimeMillis() - sess.getLastAccessedTime();
                int max = sess.getMaxInactiveInterval();
                if ( idleTime >= max )
                {
                    sessIdSet.remove( session_id );
                    sess.invalidate();
                    continue;
                }
            }
            // end for loop.
        } while ( true );
View Full Code Here

Examples of org.apache.stratum.jcs.utils.servlet.session.DistSession

    {
        //not really a pool but a factory.  needs to be changed
        // theres no way to get it back int the pool
        //DistSession sess = ds.Mgr.getDistSession()
        String session_id = null;
        DistSession sess = new DistSession();
        try
        {
            // create a cookie that corrsponds to a session value in the svo
            sess.initNew();
//      sess.initNew(req.getServerName());
            session_id = sess.getId();
            Cookie c = new Cookie( SESSION_COOKIE_NAME, session_id );
            c.setPath( "/" );
            c.setMaxAge( -1 );
            res.addCookie( c );
            if ( log.isInfoEnabled() )
View Full Code Here

Examples of org.apache.stratum.jcs.utils.servlet.session.DistSession

     * @return The distSession value
     */
    private MetaHttpSession getDistSession( HttpServletRequest req )
    {
        log.info( "in getSession" );
        DistSession sess = null;
        String session_id = getRequestedSessionId( req );

        if ( session_id == null )
        {
            log.info( "no cookie found" );
            return new MetaHttpSession( null, null );
        }
        sess = new DistSession();

        if ( !sess.init( session_id ) )
        {
            return new MetaHttpSession( session_id, null );
        }
        long idleTime = System.currentTimeMillis() - sess.getLastAccessedTime();
        int max = sess.getMaxInactiveInterval();
        if ( idleTime > max / 2 )
        {
            if ( idleTime < max )
            {
                sess.access();
            }
            else
            {
                sessIdSet.remove( session_id );
                sess.invalidate();
                return new MetaHttpSession( session_id, null );
            }
        }
        return new MetaHttpSession( session_id, sess );
    }
View Full Code Here

Examples of org.apache.stratum.jcs.utils.servlet.session.DistSession


    /** Gets the requestedSessionIdValid attribute of the DistSessionTracker object */
    public boolean isRequestedSessionIdValid( HttpServletRequest req )
    {
        DistSession sess = new DistSession();
        return sess.init( getRequestedSessionId( req ) );
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.