/** * Store the provided session in memcached if the session was modified * or if the session needs to be relocated. * * @param session * the session to save * @param sessionRelocationRequired * specifies, if the session id was changed due to a memcached failover or tomcat failover. * @return the {@link BackupResultStatus} */ public Future<BackupResult> backupSession( final String sessionId, final boolean sessionIdChanged, final String requestId ) { final MemcachedBackupSession session = _manager.getSessionInternal( sessionId ); if ( session == null ) { if(_log.isDebugEnabled()) _log.debug( "No session found in session map for " + sessionId ); return new SimpleFuture<BackupResult>( BackupResult.SKIPPED ); } _log.info( "Serializing session data for session " + session.getIdInternal() ); final long startSerialization = System.currentTimeMillis(); final byte[] data = _transcoderService.serializeAttributes( (MemcachedBackupSession) session, ((MemcachedBackupSession) session).getAttributesFiltered() ); _log.info( String.format( "Serializing %1$,.3f kb session data for session %2$s took %3$d ms.", (double)data.length / 1000, session.getIdInternal(), System.currentTimeMillis() - startSerialization ) ); _sessionData.put( session.getIdInternal(), data ); _statistics.registerSince( ATTRIBUTES_SERIALIZATION, startSerialization ); _statistics.register( CACHED_DATA_SIZE, data.length ); return new SimpleFuture<BackupResult>( new BackupResult( BackupResultStatus.SUCCESS ) ); }
if (_manager.getSessionInternal(newSessionId) != null) { return newSessionId; MemcachedBackupSession session = _manager.getSessionInternal( requestedSessionId ); if ( session == null ) { session = loadFromMemcachedWithCheck( requestedSessionId ); } else if (_manager.getSessionInternal(newSessionId) != null) { return newSessionId;
final MemcachedBackupSession msmSession = _manager.getSessionInternal( sessionId ); if ( msmSession == null ) { if(_log.isDebugEnabled())
MemcachedBackupSession result = _manager.getSessionInternal( id ); if ( result != null ) { synchronized (_manager.getSessionsInternal()) { if(_manager.getSessionInternal(id) == null) { addValidLoadedSession(result); if(_manager.getSessionInternal(id) != null) { result = _manager.getSessionInternal(id);
final MemcachedBackupSession session = _manager.getSessionInternal( requestedSessionId );
if (_manager.getSessionInternal(newSessionId) != null) { return newSessionId; MemcachedBackupSession session = _manager.getSessionInternal( requestedSessionId ); if ( session == null ) { session = loadFromMemcachedWithCheck( requestedSessionId ); } else if (_manager.getSessionInternal(newSessionId) != null) { return newSessionId;
final MemcachedBackupSession msmSession = _manager.getSessionInternal( sessionId ); if ( msmSession == null ) { if(_log.isDebugEnabled())
final MemcachedBackupSession msmSession = _manager.getSessionInternal( sessionId ); if ( msmSession == null ) { if(_log.isDebugEnabled())
/** * Store the provided session in memcached if the session was modified * or if the session needs to be relocated. * * @param session * the session to save * @param sessionRelocationRequired * specifies, if the session id was changed due to a memcached failover or tomcat failover. * @return the {@link BackupResultStatus} */ public Future<BackupResult> backupSession( final String sessionId, final boolean sessionIdChanged, final String requestId ) { final MemcachedBackupSession session = _manager.getSessionInternal( sessionId ); if ( session == null ) { if(_log.isDebugEnabled()) _log.debug( "No session found in session map for " + sessionId ); return new SimpleFuture<BackupResult>( BackupResult.SKIPPED ); } _log.info( "Serializing session data for session " + session.getIdInternal() ); final long startSerialization = System.currentTimeMillis(); final byte[] data = _transcoderService.serializeAttributes( (MemcachedBackupSession) session, ((MemcachedBackupSession) session).getAttributesFiltered() ); _log.info( String.format( "Serializing %1$,.3f kb session data for session %2$s took %3$d ms.", (double)data.length / 1000, session.getIdInternal(), System.currentTimeMillis() - startSerialization ) ); _sessionData.put( session.getIdInternal(), data ); _statistics.registerSince( ATTRIBUTES_SERIALIZATION, startSerialization ); _statistics.register( CACHED_DATA_SIZE, data.length ); return new SimpleFuture<BackupResult>( new BackupResult( BackupResultStatus.SUCCESS ) ); }
MemcachedBackupSession result = _manager.getSessionInternal( id ); if ( result != null ) { synchronized (_manager.getSessionsInternal()) { if(_manager.getSessionInternal(id) == null) { addValidLoadedSession(result); if(_manager.getSessionInternal(id) != null) { result = _manager.getSessionInternal(id);
final MemcachedBackupSession session = _manager.getSessionInternal( requestedSessionId );
final MemcachedBackupSession msmSession = _manager.getSessionInternal( sessionId ); if ( msmSession == null ) { if(_log.isDebugEnabled())