Remove periodic iteration over sessions

This commit is contained in:
Jan Bartel 2016-03-23 16:59:02 +11:00
parent 240f734d7a
commit bfeae1afa3
135 changed files with 682 additions and 901 deletions

View File

@ -185,7 +185,7 @@ public class GCloudSessionDataStore extends AbstractSessionDataStore
* @see org.eclipse.jetty.server.session.SessionDataStore#getExpired(Set, int)
*/
@Override
public Set<String> doGetExpired(Set<String> candidates, int expiryTimeoutSec)
public Set<String> doGetExpired(Set<String> candidates)
{
long now = System.currentTimeMillis();
Set<String> expired = new HashSet<String>();

View File

@ -46,7 +46,7 @@ public class GCloudSessionManager extends SessionManager
public GCloudSessionManager()
{
_sessionDataStore = new GCloudSessionDataStore();
_sessionStore = new MemorySessionStore();
setSessionStore(new MemorySessionStore(this));
}

View File

@ -134,7 +134,7 @@ public class InfinispanSessionDataStore extends AbstractSessionDataStore
* @see org.eclipse.jetty.server.session.SessionDataStore#getExpired(Set, int)
*/
@Override
public Set<String> doGetExpired(Set<String> candidates, int expiryTimeoutSec)
public Set<String> doGetExpired(Set<String> candidates)
{
if (candidates == null || candidates.isEmpty())
return candidates;

View File

@ -42,7 +42,7 @@ public class InfinispanSessionManager extends SessionManager
public InfinispanSessionManager()
{
_sessionStore = new MemorySessionStore();
setSessionStore(new MemorySessionStore(this));
_sessionDataStore = new InfinispanSessionDataStore();
}

View File

@ -348,7 +348,7 @@ public class MongoSessionDataStore extends NoSqlSessionDataStore
* @see org.eclipse.jetty.server.session.SessionDataStore#getExpired(Set, int)
*/
@Override
public Set<String> doGetExpired(Set<String> candidates, int expiryTimeoutSec)
public Set<String> doGetExpired(Set<String> candidates)
{
long now = System.currentTimeMillis();
long upperBound = now;

View File

@ -99,7 +99,7 @@ public class MongoSessionManager extends SessionManager
/* ------------------------------------------------------------ */
public MongoSessionManager() throws UnknownHostException, MongoException
{
_sessionStore = new MemorySessionStore();
setSessionStore(new MemorySessionStore(this));
_sessionDataStore = new MongoSessionDataStore();
}

View File

@ -18,12 +18,15 @@
package org.eclipse.jetty.server;
import java.util.Set;
import javax.servlet.http.HttpServletRequest;
import org.eclipse.jetty.server.session.Session;
import org.eclipse.jetty.util.component.LifeCycle;
/** Session ID Manager.
/**
* Session ID Manager.
* Manages session IDs across multiple contexts.
*/
public interface SessionIdManager extends LifeCycle
@ -104,5 +107,10 @@ public interface SessionIdManager extends LifeCycle
*/
public void renewSessionId(String oldId, String oldExtendedId, HttpServletRequest request);
/* ------------------------------------------------------------ */
/**
* Get the set of all session managers for this node
* @return
*/
public Set<SessionManager> getSessionManagers();
}

View File

@ -275,6 +275,12 @@ public interface SessionManager extends LifeCycle
* @return whether the session management is handled via URLs.
*/
public boolean isUsingURLs();
/**
* Invalidate the session corresponding to the id
* @param id the identity of the session to invalidate
*/
public void invalidate(String id);
public Set<SessionTrackingMode> getDefaultSessionTrackingModes();
@ -321,5 +327,10 @@ public interface SessionManager extends LifeCycle
*/
public boolean isIdInUse (String id) throws Exception;
/**
*
*/
public void scavenge ();
}

View File

@ -52,10 +52,9 @@ public abstract class AbstractSessionDataStore extends AbstractLifeCycle impleme
* should attempt to expire.
*
* @param candidates the ids of sessions the SessionStore thinks has expired
* @param scavengePeriodSec the period in sec of the scavenge cycle checks
* @return the reconciled set of session ids that this node should attempt to expire
*/
public abstract Set<String> doGetExpired (Set<String> candidates, int scavengePeriodSec);
public abstract Set<String> doGetExpired (Set<String> candidates);
/**
@ -95,14 +94,14 @@ public abstract class AbstractSessionDataStore extends AbstractLifeCycle impleme
/**
* @see org.eclipse.jetty.server.session.SessionDataStore#getExpired(java.util.Set, int)
* @see org.eclipse.jetty.server.session.SessionDataStore#getExpired(java.util.Set)
*/
@Override
public Set<String> getExpired(Set<String> candidates, int scavengePeriodSec)
public Set<String> getExpired(Set<String> candidates)
{
try
{
return doGetExpired (candidates, scavengePeriodSec);
return doGetExpired (candidates);
}
finally
{

View File

@ -1,103 +0,0 @@
//
// ========================================================================
// Copyright (c) 1995-2016 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
// and Apache License v2.0 which accompanies this distribution.
//
// The Eclipse Public License is available at
// http://www.eclipse.org/legal/epl-v10.html
//
// The Apache License v2.0 is available at
// http://www.opensource.org/licenses/apache2.0.php
//
// You may elect to redistribute this code under either of these licenses.
// ========================================================================
//
package org.eclipse.jetty.server.session;
/**
* AbstractInspector
*/
public abstract class AbstractSessionInspector implements SessionInspector
{
/**
* <ul>
* <li>&lt;0 means never inspect</li>
* <li>0 means always inspect</li>
* <li>&gt;0 means inspect at that interval</li>
* </ul>
*/
protected int _timeoutSec = -1;
/**
* -ve means never inspect
* 0 means always inspect
* +ve means inspect at interval
*/
protected long _lastTime;
/**
* @see org.eclipse.jetty.server.session.SessionInspector#getTimeoutSec()
*/
@Override
public int getTimeoutSec()
{
return _timeoutSec;
}
/**
* @see org.eclipse.jetty.server.session.SessionInspector#setTimeoutSet(int)
*/
@Override
public void setTimeoutSet(int sec)
{
_timeoutSec = sec;
}
/**
* @see org.eclipse.jetty.server.session.SessionInspector#preInspection()
*/
@Override
public boolean preInspection()
{
long now = System.currentTimeMillis();
return checkTimeout(now);
}
/**
* @see org.eclipse.jetty.server.session.SessionInspector#inspect(org.eclipse.jetty.server.session.Session)
*/
@Override
public void inspect(Session s)
{
_lastTime = System.currentTimeMillis();
}
/**
* @see org.eclipse.jetty.server.session.SessionInspector#postInspection()
*/
@Override
public void postInspection()
{
}
protected boolean checkTimeout (long now)
{
if (_timeoutSec == 0)
return true; // always inspect
if (_timeoutSec < 0)
return false; //never inspect
if (_lastTime == 0)
return true; //always perform inspection on first use
return ((now - _lastTime)*1000L) >= _timeoutSec; //only inspect if interval since last inspection has expired
}
}

View File

@ -42,24 +42,29 @@ public abstract class AbstractSessionStore extends AbstractLifeCycle implements
{
final static Logger LOG = Log.getLogger("org.eclipse.jetty.server.session");
protected ArrayList<SessionInspector> _inspectors = new ArrayList<SessionInspector>();
protected SessionDataStore _sessionDataStore;
protected SessionManager _manager;
protected final SessionManager _manager;
protected SessionContext _context;
protected int _idlePassivationTimeoutSec;
protected int _expiryTimeoutSec;
private IdleInspector _idleInspector;
private ExpiryInspector _expiryInspector;
private boolean _passivateOnComplete;
/**
* Create a new Session object from session data
* Create a new Session object from pre-existing session data
* @param data the session data
* @return a new Session object
*/
public abstract Session newSession (SessionData data);
/**
* Create a new Session for a request.
*
* @param request
* @param data
* @return
*/
public abstract Session newSession (HttpServletRequest request, SessionData data);
/**
@ -121,19 +126,14 @@ public abstract class AbstractSessionStore extends AbstractLifeCycle implements
/**
*
*/
public AbstractSessionStore ()
{
}
/**
* @param manager the SessionManager
*/
public void setSessionManager (SessionManager manager)
public AbstractSessionStore (SessionManager manager)
{
_manager = manager;
}
/**
* @return the SessionManger
*/
@ -171,15 +171,6 @@ public abstract class AbstractSessionStore extends AbstractLifeCycle implements
_sessionDataStore.initialize(_context);
_sessionDataStore.start();
if (_expiryTimeoutSec >= 0)
{
synchronized (_inspectors)
{
_expiryInspector = new ExpiryInspector(this, _manager.getSessionIdManager());
_expiryInspector.setTimeoutSet(_expiryTimeoutSec);
_inspectors.add(0, _expiryInspector);
}
}
super.doStart();
}
@ -191,7 +182,6 @@ public abstract class AbstractSessionStore extends AbstractLifeCycle implements
protected void doStop() throws Exception
{
_sessionDataStore.stop();
_expiryInspector = null;
super.doStop();
}
@ -228,47 +218,12 @@ public abstract class AbstractSessionStore extends AbstractLifeCycle implements
*/
public void setIdlePassivationTimeoutSec(int idleTimeoutSec)
{
synchronized (_inspectors)
{
_idlePassivationTimeoutSec = idleTimeoutSec;
if (_idlePassivationTimeoutSec == 0)
{
if (_idleInspector != null)
_inspectors.remove(_idleInspector);
_idleInspector = null;
}
else
{
if (_idleInspector == null)
{
_idleInspector = new IdleInspector(this);
_inspectors.add(_idleInspector);
}
_idlePassivationTimeoutSec = idleTimeoutSec;
_idleInspector.setTimeoutSet(_idlePassivationTimeoutSec);
}
}
}
/**
* @return the expiryTimeoutSec
*/
public int getExpiryTimeoutSec()
{
return _expiryTimeoutSec;
}
/**
* @param expiryTimeoutSec the expiryTimeoutSec to set
*/
public void setExpiryTimeoutSec(int expiryTimeoutSec)
{
_expiryTimeoutSec = expiryTimeoutSec;
}
@ -330,10 +285,13 @@ public abstract class AbstractSessionStore extends AbstractLifeCycle implements
phsLock.close();
break;
}
//successfully swapped in the session
phsLock.close();
break;
else
{
//successfully swapped in the session
session.setTimeout (); //TODO start the session timer
phsLock.close();
break;
}
}
}
catch (Exception e)
@ -485,29 +443,8 @@ public abstract class AbstractSessionStore extends AbstractLifeCycle implements
}
}
doPutIfAbsent(id,session); //ensure it is in our map
doPutIfAbsent(id,session); //ensure it is in our map
}
/* if ((session.isNew() || session.getSessionData().isDirty()) && _sessionDataStore != null)
{
if (_sessionDataStore.isPassivating())
{
session.willPassivate();
try
{
_sessionDataStore.store(id, session.getSessionData());
}
finally
{
session.didActivate();
}
}
else
_sessionDataStore.store(id, session.getSessionData());
}
doPutIfAbsent(id,session);*/
}
/**
@ -559,6 +496,9 @@ public abstract class AbstractSessionStore extends AbstractLifeCycle implements
}
//delete it from the session object store
if (session != null)
session.stopTimeout();
return doDelete(id);
}
@ -578,46 +518,13 @@ public abstract class AbstractSessionStore extends AbstractLifeCycle implements
if (LOG.isDebugEnabled())
LOG.debug("SessionStore checking expiration on {}", candidates);
return _sessionDataStore.getExpired(candidates, _expiryTimeoutSec);
return _sessionDataStore.getExpired(candidates);
}
/**
* @see org.eclipse.jetty.server.session.SessionStore#inspect()
*/
public void inspect ()
{
Stream<Session> stream = getStream();
synchronized (_inspectors)
{
try
{
final ArrayList<Boolean> wantInspect = new ArrayList<Boolean>();
for (SessionInspector i:_inspectors)
wantInspect.add(Boolean.valueOf(i.preInspection()));
stream.forEach(s->{for (int i=0;i<_inspectors.size(); i++) { if (wantInspect.get(i)) _inspectors.get(i).inspect(s);}});
}
finally
{
try
{
for (SessionInspector i:_inspectors)
i.postInspection();
}
catch (Exception e)
{
LOG.warn(e);
}
stream.close();
}
}
}
/**
@ -626,6 +533,7 @@ public abstract class AbstractSessionStore extends AbstractLifeCycle implements
*
* @param id identity of session to passivate
*/
@Override
public void passivateIdleSession(String id)
{
if (!isStarted())
@ -660,6 +568,7 @@ public abstract class AbstractSessionStore extends AbstractLifeCycle implements
s.willPassivate();
_sessionDataStore.store(id, s.getSessionData());
s.setPassivated();
s.stopTimeout();
doDelete(id); //Take the session object of this session store
}
catch (Exception e)
@ -725,6 +634,8 @@ public abstract class AbstractSessionStore extends AbstractLifeCycle implements
@Override
public Session newSession(HttpServletRequest request, String id, long time, long maxInactiveMs)
{
return null;
Session session = newSession(request, _sessionDataStore.newSessionData(id, time, time, time, maxInactiveMs));
session.setSessionManager(_manager);
return session;
}
}

View File

@ -116,10 +116,10 @@ public class CachingSessionDataStore extends AbstractSessionDataStore
}
/**
* @see org.eclipse.jetty.server.session.SessionDataStore#getExpired(Set, int)
* @see org.eclipse.jetty.server.session.SessionDataStore#getExpired(Set)
*/
@Override
public Set<String> doGetExpired(Set<String> candidates, int expiryTimeoutSec)
public Set<String> doGetExpired(Set<String> candidates)
{
// TODO Auto-generated method stub
return null;

View File

@ -29,6 +29,7 @@ import javax.servlet.http.HttpServletRequest;
import org.eclipse.jetty.server.Handler;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.SessionIdManager;
import org.eclipse.jetty.server.SessionManager;
import org.eclipse.jetty.server.handler.ContextHandler;
import org.eclipse.jetty.util.component.AbstractLifeCycle;
import org.eclipse.jetty.util.log.Log;
@ -58,7 +59,7 @@ public class DefaultSessionIdManager extends AbstractLifeCycle implements Sessio
protected String _workerAttr;
protected long _reseed=100000L;
protected Server _server;
protected PeriodicSessionInspector _inspector;
protected HouseKeeper _inspector;
/* ------------------------------------------------------------ */
@ -106,7 +107,7 @@ public class DefaultSessionIdManager extends AbstractLifeCycle implements Sessio
/**
* @param inspector inspector of sessions
*/
public void setSessionInspector (PeriodicSessionInspector inspector)
public void setSessionInspector (HouseKeeper inspector)
{
_inspector = inspector;
_inspector.setSessionIdManager(this);
@ -296,7 +297,7 @@ public class DefaultSessionIdManager extends AbstractLifeCycle implements Sessio
if (manager.isIdInUse(id))
{
if (LOG.isDebugEnabled())
LOG.debug("Context {} reports id in use", manager.getContext());
LOG.debug("Context {} reports id in use", manager);
inUse = true;
break;
}
@ -330,7 +331,7 @@ public class DefaultSessionIdManager extends AbstractLifeCycle implements Sessio
if (_inspector == null)
{
LOG.warn("No SessionScavenger set, using defaults");
_inspector = new PeriodicSessionInspector();
_inspector = new HouseKeeper();
_inspector.setSessionIdManager(this);
}
@ -473,9 +474,9 @@ public class DefaultSessionIdManager extends AbstractLifeCycle implements Sessio
*
* @return all session managers
*/
protected Set<SessionManager> getSessionManagers()
public Set<org.eclipse.jetty.server.SessionManager> getSessionManagers()
{
Set<SessionManager> managers = new HashSet<>();
Set<org.eclipse.jetty.server.SessionManager> managers = new HashSet<>();
Handler[] contexts = _server.getChildHandlersByClass(ContextHandler.class);
for (int i=0; contexts!=null && i<contexts.length; i++)

View File

@ -1,119 +0,0 @@
//
// ========================================================================
// Copyright (c) 1995-2016 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
// and Apache License v2.0 which accompanies this distribution.
//
// The Eclipse Public License is available at
// http://www.eclipse.org/legal/epl-v10.html
//
// The Apache License v2.0 is available at
// http://www.opensource.org/licenses/apache2.0.php
//
// You may elect to redistribute this code under either of these licenses.
// ========================================================================
//
package org.eclipse.jetty.server.session;
import java.util.HashSet;
import java.util.Set;
import org.eclipse.jetty.server.SessionIdManager;
import org.eclipse.jetty.util.log.Log;
import org.eclipse.jetty.util.log.Logger;
/**
* ExpiryInspector
*
*
*/
public class ExpiryInspector extends AbstractSessionInspector
{
private final static Logger LOG = Log.getLogger("org.eclipse.jetty.server.session");
protected Set<String> _expiryCandidates = new HashSet<String>();
protected SessionIdManager _idManager;
protected AbstractSessionStore _sessionStore;
/**
* @param sessionStore the session store
* @param idManager the session id manager
*/
public ExpiryInspector (AbstractSessionStore sessionStore, SessionIdManager idManager)
{
_idManager = idManager;
_sessionStore = sessionStore;
}
/**
* @see org.eclipse.jetty.server.session.SessionInspector#inspect(Session)
*/
@Override
public void inspect(Session s)
{
//Does the session object think it is expired?
long now = System.currentTimeMillis();
if (s.isExpiredAt(now))
_expiryCandidates.add(s.getId());
}
/**
* @return the expiryCandidates
*/
public Set<String> getExpiryCandidates()
{
return _expiryCandidates;
}
/**
* @see org.eclipse.jetty.server.session.SessionInspector#preInspection()
*/
@Override
public boolean preInspection()
{
_expiryCandidates.clear();
boolean shouldInspect = super.preInspection();
if (LOG.isDebugEnabled())
LOG.debug("ExpiryInspector, will inspect:{}", shouldInspect);
return shouldInspect;
}
/**
* @see org.eclipse.jetty.server.session.SessionInspector#postInspection()
*/
@Override
public void postInspection()
{
if (LOG.isDebugEnabled())
LOG.debug("ExpiryInspector checking expiration for {}", _expiryCandidates);
try
{
Set<String> candidates = _sessionStore.checkExpiration(_expiryCandidates);
for (String id:candidates)
{
_idManager.expireAll(id);
}
}
catch (Exception e)
{
LOG.warn(e);
}
finally
{
_expiryCandidates.clear();
}
}
}

View File

@ -115,7 +115,7 @@ public class FileSessionDataStore extends AbstractSessionDataStore
* @see org.eclipse.jetty.server.session.SessionDataStore#getExpired(Set, int)
*/
@Override
public Set<String> doGetExpired(final Set<String> candidates, final int expiryTimeoutSec)
public Set<String> doGetExpired(final Set<String> candidates)
{
final long now = System.currentTimeMillis();
HashSet<String> expired = new HashSet<String>();

View File

@ -34,7 +34,7 @@ public class FileSessionManager extends SessionManager
*/
public FileSessionManager ()
{
_sessionStore = new MemorySessionStore();
setSessionStore(new MemorySessionStore(this));
_sessionDataStore = new FileSessionDataStore();
}

View File

@ -35,7 +35,7 @@ public class HashSessionManager extends SessionManager
*/
public HashSessionManager ()
{
_sessionStore = new MemorySessionStore();
setSessionStore(new MemorySessionStore(this));
}
@Override

View File

@ -22,6 +22,7 @@ package org.eclipse.jetty.server.session;
import java.util.concurrent.TimeUnit;
import org.eclipse.jetty.server.SessionIdManager;
import org.eclipse.jetty.server.SessionManager;
import org.eclipse.jetty.util.component.AbstractLifeCycle;
import org.eclipse.jetty.util.log.Log;
import org.eclipse.jetty.util.log.Logger;
@ -29,12 +30,12 @@ import org.eclipse.jetty.util.thread.ScheduledExecutorScheduler;
import org.eclipse.jetty.util.thread.Scheduler;
/**
* SessionScavenger
* HouseKeeper
*
* There is 1 session scavenger per SessionIdManager/Server instance.
* There is 1 session HouseKeeper per SessionIdManager instance.
*
*/
public class PeriodicSessionInspector extends AbstractLifeCycle
public class HouseKeeper extends AbstractLifeCycle
{
private final static Logger LOG = Log.getLogger("org.eclipse.jetty.server.session");
@ -61,7 +62,7 @@ public class PeriodicSessionInspector extends AbstractLifeCycle
{
try
{
inspect();
scavenge();
}
finally
{
@ -91,14 +92,14 @@ public class PeriodicSessionInspector extends AbstractLifeCycle
protected void doStart() throws Exception
{
if (_sessionIdManager == null)
throw new IllegalStateException ("No SessionIdManager for Scavenger");
throw new IllegalStateException ("No SessionIdManager for Housekeeper");
if (!(_sessionIdManager instanceof DefaultSessionIdManager))
throw new IllegalStateException ("SessionIdManager is not an AbstractSessionIdManager");
//try and use a common scheduler, fallback to own
_scheduler = ((DefaultSessionIdManager)_sessionIdManager).getServer().getBean(Scheduler.class);
if (_sessionIdManager instanceof DefaultSessionIdManager)
{
//try and use a common scheduler, fallback to own
_scheduler = ((DefaultSessionIdManager)_sessionIdManager).getServer().getBean(Scheduler.class);
}
if (_scheduler == null)
{
@ -185,11 +186,9 @@ public class PeriodicSessionInspector extends AbstractLifeCycle
/**
* Perform a scavenge cycle:
* ask all SessionManagers to find sessions they think have expired and then make
* sure that a session sharing the same id is expired on all contexts
* Periodically do session housekeeping
*/
public void inspect ()
public void scavenge ()
{
//don't attempt to scavenge if we are shutting down
if (isStopping() || isStopped())
@ -199,11 +198,18 @@ public class PeriodicSessionInspector extends AbstractLifeCycle
LOG.debug("Inspecting sessions");
//find the session managers
for (SessionManager manager:((DefaultSessionIdManager)_sessionIdManager).getSessionManagers())
for (SessionManager manager:_sessionIdManager.getSessionManagers())
{
if (manager != null)
{
manager.inspect();
try
{
manager.scavenge();
}
catch (Exception e)
{
LOG.warn(e);
}
}
}
}

View File

@ -1,114 +0,0 @@
//
// ========================================================================
// Copyright (c) 1995-2016 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
// and Apache License v2.0 which accompanies this distribution.
//
// The Eclipse Public License is available at
// http://www.eclipse.org/legal/epl-v10.html
//
// The Apache License v2.0 is available at
// http://www.opensource.org/licenses/apache2.0.php
//
// You may elect to redistribute this code under either of these licenses.
// ========================================================================
//
package org.eclipse.jetty.server.session;
import java.util.HashSet;
import java.util.Set;
import org.eclipse.jetty.util.log.Log;
import org.eclipse.jetty.util.log.Logger;
/**
* IdleExpiryInspector
*
* Checks if a session is idle
*/
public class IdleInspector extends AbstractSessionInspector
{
private final static Logger LOG = Log.getLogger("org.eclipse.jetty.server.session");
protected Set<String> _idleCandidates = new HashSet<String>();;
protected AbstractSessionStore _sessionStore;
/**
* @param sessionStore the session store
*/
public IdleInspector (AbstractSessionStore sessionStore)
{
_sessionStore = sessionStore;
}
/**
* @see org.eclipse.jetty.server.session.SessionInspector#inspect(org.eclipse.jetty.server.session.Session)
*/
@Override
public void inspect(Session s)
{
//Does the session object think it is expired?
long now = System.currentTimeMillis();
if (s.isExpiredAt(now))
return;
if (s.isValid() && s.isIdleLongerThan(_sessionStore.getIdlePassivationTimeoutSec()))
{
_idleCandidates.add(s.getId());
};
}
/**
* @return the idleCandidates
*/
public Set<String> getIdleCandidates()
{
return _idleCandidates;
}
/**
* @see org.eclipse.jetty.server.session.SessionInspector#preInspection()
*/
@Override
public boolean preInspection()
{
boolean shouldInspect = super.preInspection();
if (LOG.isDebugEnabled())
LOG.debug("IdleInspector will inspect:{}", shouldInspect);
return shouldInspect;
}
/**
* @see org.eclipse.jetty.server.session.SessionInspector#postInspection()
*/
@Override
public void postInspection()
{
if (LOG.isDebugEnabled())
LOG.debug("IdleInspector postinspection");
for (String id:_idleCandidates)
{
try
{
_sessionStore.passivateIdleSession(id);
}
catch (Exception e)
{
LOG.warn(e);
}
}
_idleCandidates.clear();
}
}

View File

@ -884,10 +884,10 @@ public class JDBCSessionDataStore extends AbstractSessionDataStore
/**
* @see org.eclipse.jetty.server.session.SessionDataStore#getExpired(Set, int)
* @see org.eclipse.jetty.server.session.SessionDataStore#getExpired(Set)
*/
@Override
public Set<String> doGetExpired(Set<String> candidates, int scavengeIntervalSec)
public Set<String> doGetExpired(Set<String> candidates)
{
if (LOG.isDebugEnabled())
LOG.debug("Getting expired sessions "+System.currentTimeMillis());

View File

@ -31,7 +31,7 @@ public class JDBCSessionManager extends SessionManager
public JDBCSessionManager()
{
_sessionStore = new MemorySessionStore();
setSessionStore(new MemorySessionStore(this));
_sessionDataStore = new JDBCSessionDataStore();
}

View File

@ -73,9 +73,9 @@ public class MemorySessionStore extends AbstractSessionStore
public MemorySessionStore ()
public MemorySessionStore (SessionManager manager)
{
super();
super (manager);
}
@ -193,12 +193,12 @@ public class MemorySessionStore extends AbstractSessionStore
/**
* @see org.eclipse.jetty.server.session.AbstractSessionStore#newSession(javax.servlet.http.HttpServletRequest, java.lang.String, long, long)
* @see org.eclipse.jetty.server.session.AbstractSessionStore#newSession(javax.servlet.http.HttpServletRequest, org.eclipse.jetty.server.session.SessionData)
*/
@Override
public Session newSession(HttpServletRequest request, String id, long time, long maxInactiveMs)
public Session newSession(HttpServletRequest request, SessionData data)
{
MemorySession s = new MemorySession(request, _sessionDataStore.newSessionData(id, time, time, time, maxInactiveMs));
MemorySession s = new MemorySession(request,data);
return s;
}
@ -216,14 +216,6 @@ public class MemorySessionStore extends AbstractSessionStore
}
/**
* @see org.eclipse.jetty.server.session.SessionStore#getStream()
*/
@Override
public Stream<Session> getStream()
{
return _sessions.values().stream();
}
/**

View File

@ -69,10 +69,10 @@ public class NullSessionDataStore extends AbstractSessionDataStore
/**
* @see org.eclipse.jetty.server.session.SessionDataStore#getExpired(Set, int)
* @see org.eclipse.jetty.server.session.SessionDataStore#getExpired(Set)
*/
@Override
public Set<String> doGetExpired(Set<String> candidates, int expiryTimeoutSec)
public Set<String> doGetExpired(Set<String> candidates)
{
return candidates; //whatever is suggested we accept
}

View File

@ -24,6 +24,8 @@ import java.util.Collections;
import java.util.Enumeration;
import java.util.Iterator;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
@ -33,10 +35,13 @@ import javax.servlet.http.HttpSessionBindingListener;
import javax.servlet.http.HttpSessionContext;
import javax.servlet.http.HttpSessionEvent;
import org.eclipse.jetty.io.IdleTimeout;
import org.eclipse.jetty.server.Request;
import org.eclipse.jetty.util.log.Log;
import org.eclipse.jetty.util.log.Logger;
import org.eclipse.jetty.util.thread.Locker;
import org.eclipse.jetty.util.thread.Locker.Lock;
import org.eclipse.jetty.util.thread.Scheduler;
@ -73,20 +78,76 @@ public class Session implements SessionManager.SessionIf
public enum PassivationState {PASSIVATED, ACTIVE};
protected SessionData _sessionData;
protected SessionManager _manager;
protected SessionData _sessionData; //the actual data associated with a session
protected SessionManager _manager; //the manager of the session
protected String _extendedId; //the _id plus the worker name
protected long _requests;
private boolean _idChanged;
private boolean _idChanged;
private boolean _newSession;
private State _state = State.VALID; //state of the session:valid,invalid or being invalidated
private Locker _lock = new Locker();
private PassivationState _passivationState = PassivationState.ACTIVE;
private Locker _lock = new Locker(); //sync lock
private PassivationState _passivationState = PassivationState.ACTIVE; //passivated or not
private InspectionTimeout _inspectionTimeout = null;
/* ------------------------------------------------------------- */
/**
* InspectionTimeout
*
*
*/
public class InspectionTimeout extends IdleTimeout
{
public InspectionTimeout()
{
super(getSessionManager().getScheduler());
}
/**
* @see org.eclipse.jetty.io.IdleTimeout#onIdleExpired(java.util.concurrent.TimeoutException)
*/
@Override
protected void onIdleExpired(TimeoutException timeout)
{
//called when the timer goes off
if (LOG.isDebugEnabled()) LOG.debug("Timer expired for session {}", getId());
getSessionManager().inspect(Session.this);
}
/**
* @see org.eclipse.jetty.io.IdleTimeout#isOpen()
*/
@Override
public boolean isOpen()
{
// Called to determine if the timer should be reset
// True if:
// 1. the session is still valid
// BUT if passivated out to disk, do we really want this timer to keep going off?
try (Lock lock = _lock.lockIfNotHeld())
{
return isValid() && !isPassivated();
}
}
/**
* @see org.eclipse.jetty.io.IdleTimeout#setIdleTimeout(long)
*/
@Override
public void setIdleTimeout(long idleTimeout)
{
if (LOG.isDebugEnabled()) LOG.debug("setIdleTimeout called: "+idleTimeout);
super.setIdleTimeout(idleTimeout);
}
}
/* ------------------------------------------------------------- */
/**
* Create a new session
*
@ -101,7 +162,8 @@ public class Session implements SessionManager.SessionIf
}
/* ------------------------------------------------------------- */
/**
* Re-create an existing session
* @param data the session data
@ -111,7 +173,8 @@ public class Session implements SessionManager.SessionIf
_sessionData = data;
}
/* ------------------------------------------------------------- */
/**
* Should call this method with a lock held if you want to
* make decision on what to do with the session
@ -127,13 +190,21 @@ public class Session implements SessionManager.SessionIf
}
/* ------------------------------------------------------------- */
/**
* @param manager
*/
public void setSessionManager (SessionManager manager)
{
_manager = manager;
}
/* ------------------------------------------------------------- */
/**
* @param extendedId
*/
public void setExtendedId (String extendedId)
{
_extendedId = extendedId;
@ -204,19 +275,7 @@ public class Session implements SessionManager.SessionIf
}
}
/* ------------------------------------------------------------ */
public void setLastNode (String nodename)
{
_sessionData.setLastNode(nodename);
}
/* ------------------------------------------------------------ */
public String getLastNode ()
{
return _sessionData.getLastNode();
}
/* ------------------------------------------------------------ */
/**
@ -404,12 +463,71 @@ public class Session implements SessionManager.SessionIf
try (Lock lock = _lock.lockIfNotHeld())
{
_sessionData.setMaxInactiveMs((long)secs*1000L);
_sessionData.setExpiry(_sessionData.getMaxInactiveMs() <= 0 ? 0 : (System.currentTimeMillis() + _sessionData.getMaxInactiveMs()));
_sessionData.setExpiry(_sessionData.calcExpiry());
_sessionData.setDirty(true);
setTimeout();
if (secs <= 0)
{
LOG.warn("Session {} is now immortal (maxInactiveInterval={})", _sessionData.getId(), secs);
}
else if (LOG.isDebugEnabled())
{
LOG.debug("Session {} maxInactiveInterval={}", _sessionData.getId(), secs);
}
}
}
/**
*
*/
public void setTimeout ()
{
try (Lock lock = _lock.lockIfNotHeld())
{
if (LOG.isDebugEnabled())LOG.debug("Set timeout called");
long maxInactive = _sessionData.getMaxInactiveMs();
long maxIdle = TimeUnit.SECONDS.toMillis(getSessionManager().getSessionStore().getIdlePassivationTimeoutSec());
if (maxInactive <= 0 && maxIdle <=0)
{
//session is immortal and idle passivation is not supported
if (_inspectionTimeout != null)
_inspectionTimeout.setIdleTimeout(-1);
if (LOG.isDebugEnabled()) LOG.debug("Session maxInactive <= 0 && idlePassivation <=0: timer cancelled");
return;
}
if (_inspectionTimeout == null)
_inspectionTimeout = new InspectionTimeout();
//set the inspection timer to the smaller of the maxIdle interval or the idlePassivation interval
long timeout = 0;
if (maxInactive <= 0)
timeout = maxIdle;
else if (maxIdle <= 0)
timeout = maxInactive;
else
timeout = Math.min(maxInactive, maxIdle);
_inspectionTimeout.setIdleTimeout(timeout);
if (LOG.isDebugEnabled()) LOG.debug("Session timer(ms)={}", timeout);
}
}
public void stopTimeout ()
{
try (Lock lock = _lock.lockIfNotHeld())
{
if (_inspectionTimeout != null)
{
_inspectionTimeout.setIdleTimeout(-1);
_inspectionTimeout = null;
if (LOG.isDebugEnabled()) LOG.debug("Session timer stopped");
}
}
}

View File

@ -44,24 +44,28 @@ public class SessionData implements Serializable
private static final long serialVersionUID = 1L;
protected String _id;
protected String _contextPath;
protected String _vhost;
protected String _lastNode;
protected long _expiry;
protected long _expiry; //precalculated time of expiry in ms since epoch
protected long _created;
protected long _cookieSet;
protected long _accessed; // the time of the last access
protected long _lastAccessed; // the time of the last access excluding this one
// protected boolean _invalid;
protected long _maxInactiveMs;
protected Map<String,Object> _attributes = new ConcurrentHashMap<String, Object>();
protected boolean _dirty;
protected long _lastSaved; //time in msec since last save
/**
* @param id
* @param cpath
* @param vhost
* @param created
* @param accessed
* @param lastAccessed
* @param maxInactiveMs
*/
public SessionData (String id, String cpath, String vhost, long created, long accessed, long lastAccessed, long maxInactiveMs)
{
_id = id;
@ -71,8 +75,9 @@ public class SessionData implements Serializable
_accessed = accessed;
_lastAccessed = lastAccessed;
_maxInactiveMs = maxInactiveMs;
_expiry = calcExpiry();
}
/**
* Copy the info from the given sessiondata
@ -249,6 +254,11 @@ public class SessionData implements Serializable
{
_expiry = expiry;
}
public long calcExpiry ()
{
return (getMaxInactiveMs() <= 0 ? 0 : (System.currentTimeMillis() + getMaxInactiveMs()));
}
public long getCreated()
{

View File

@ -93,10 +93,9 @@ public interface SessionDataStore extends LifeCycle
* @param candidates if provided, these are keys of sessions that
* the SessionStore thinks has expired and should be verified by the
* SessionDataStore
* @param scavengePeriodSec the time to attempt scavenge (in seconds)
* @return set of session ids
*/
public Set<String> getExpired (Set<String> candidates, int scavengePeriodSec);
public Set<String> getExpired (Set<String> candidates);

View File

@ -1,36 +0,0 @@
//
// ========================================================================
// Copyright (c) 1995-2016 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
// and Apache License v2.0 which accompanies this distribution.
//
// The Eclipse Public License is available at
// http://www.eclipse.org/legal/epl-v10.html
//
// The Apache License v2.0 is available at
// http://www.opensource.org/licenses/apache2.0.php
//
// You may elect to redistribute this code under either of these licenses.
// ========================================================================
//
package org.eclipse.jetty.server.session;
/**
* SessionInspector
*
*
*/
public interface SessionInspector
{
public int getTimeoutSec();
public void setTimeoutSet(int sec);
public boolean preInspection();
public void inspect(Session s);
public void postInspection (); //on completion
}

View File

@ -43,6 +43,7 @@ import org.eclipse.jetty.http.HttpCookie;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.SessionIdManager;
import org.eclipse.jetty.server.handler.ContextHandler;
import org.eclipse.jetty.util.ConcurrentHashSet;
import org.eclipse.jetty.util.StringUtil;
import org.eclipse.jetty.util.annotation.ManagedAttribute;
import org.eclipse.jetty.util.annotation.ManagedOperation;
@ -51,6 +52,9 @@ import org.eclipse.jetty.util.log.Log;
import org.eclipse.jetty.util.log.Logger;
import org.eclipse.jetty.util.statistic.CounterStatistic;
import org.eclipse.jetty.util.statistic.SampleStatistic;
import org.eclipse.jetty.util.thread.Locker.Lock;
import org.eclipse.jetty.util.thread.ScheduledExecutorScheduler;
import org.eclipse.jetty.util.thread.Scheduler;
import static java.lang.Math.round;
@ -135,6 +139,12 @@ public class SessionManager extends ContainerLifeCycle implements org.eclipse.je
private boolean _usingURLs;
private boolean _usingCookies=true;
protected ConcurrentHashSet<String> _candidateSessionIdsForExpiry = new ConcurrentHashSet<String>();
protected Scheduler _scheduler;
protected boolean _ownScheduler = false;
@ -281,6 +291,15 @@ public class SessionManager extends ContainerLifeCycle implements org.eclipse.je
// server session id is never managed by this manager
addBean(_sessionIdManager,false);
}
_scheduler = server.getBean(Scheduler.class);
if (_scheduler == null)
{
_scheduler = new ScheduledExecutorScheduler();
_ownScheduler = true;
_scheduler.start();
}
}
@ -316,11 +335,7 @@ public class SessionManager extends ContainerLifeCycle implements org.eclipse.je
_checkingRemoteSessionIdEncoding=Boolean.parseBoolean(tmp);
}
_sessionContext = new SessionContext(_sessionIdManager.getWorkerName(), _context);
if (_sessionStore instanceof AbstractSessionStore)
((AbstractSessionStore)_sessionStore).setSessionManager(this);
_sessionContext = new SessionContext(_sessionIdManager.getWorkerName(), _context);
_sessionStore.initialize(_sessionContext);
_sessionStore.start();
@ -334,6 +349,9 @@ public class SessionManager extends ContainerLifeCycle implements org.eclipse.je
{
shutdownSessions();
_sessionStore.stop();
if (_ownScheduler && _scheduler != null)
_scheduler.stop();
_scheduler = null;
super.doStop();
_loader=null;
}
@ -581,14 +599,12 @@ public class SessionManager extends ContainerLifeCycle implements org.eclipse.je
@Override
public HttpSession newHttpSession(HttpServletRequest request)
{
long created=System.currentTimeMillis();
String id =_sessionIdManager.newSessionId(request,created);
Session session = _sessionStore.newSession(request, id, created, (_dftMaxIdleSecs>0?_dftMaxIdleSecs*1000L:-1));
session.setExtendedId(_sessionIdManager.getExtendedId(id,request));
session.setSessionManager(this);
session.setLastNode(_sessionIdManager.getWorkerName());
session.getSessionData().setExpiry(_dftMaxIdleSecs <= 0 ? 0 : (created + _dftMaxIdleSecs*1000L));
session.setExtendedId(_sessionIdManager.getExtendedId(id, request));
session.getSessionData().setLastNode(_sessionIdManager.getWorkerName());
session.setMaxInactiveInterval(_dftMaxIdleSecs>0?_dftMaxIdleSecs:-1); //TODO awkward: needed to kick off timer and calc expiry
if (request.isSecure())
session.setAttribute(Session.SESSION_CREATED_SECURE, Boolean.TRUE);
try
@ -740,8 +756,8 @@ public class SessionManager extends ContainerLifeCycle implements org.eclipse.je
return null;
}
session.setExtendedId(_sessionIdManager.getExtendedId(id, null)); //TODO not sure if this is OK?
session.setLastNode(_sessionIdManager.getWorkerName()); //TODO write through the change of node?
session.setExtendedId(_sessionIdManager.getExtendedId(id, null));
session.getSessionData().setLastNode(_sessionIdManager.getWorkerName()); //TODO write through the change of node?
}
return session;
}
@ -788,6 +804,15 @@ public class SessionManager extends ContainerLifeCycle implements org.eclipse.je
return _sessionStore;
}
/**
* @param store
*/
public void setSessionStore (SessionStore store)
{
_sessionStore = store;
}
/* ------------------------------------------------------------ */
/**
* @return true if the cluster node id (worker id) is returned as part of the session id by {@link HttpSession#getId()}. Default is false.
@ -1020,21 +1045,80 @@ public class SessionManager extends ContainerLifeCycle implements org.eclipse.je
}
}
/* ------------------------------------------------------------ */
/**
*
*/
public void inspect ()
public void scavenge ()
{
//don't attempt to scavenge if we are shutting down
if (isStopping() || isStopped())
return;
_sessionStore.inspect();
if (LOG.isDebugEnabled()) LOG.debug("Scavenging sessions");
//Get a snapshot of the candidates as they are now. Others that
//arrive during this processing will be dealt with on
//subsequent call to scavenge
String[] ss = _candidateSessionIdsForExpiry.toArray(new String[0]);
Set<String> candidates = new HashSet<String>(Arrays.asList(ss));
_candidateSessionIdsForExpiry.removeAll(candidates);
if (LOG.isDebugEnabled())
LOG.debug("Scavenging session ids {}", candidates);
try
{
candidates = _sessionStore.checkExpiration(candidates);
for (String id:candidates)
{
try
{
getSessionIdManager().expireAll(id);
}
catch (Exception e)
{
LOG.warn(e);
}
}
}
catch (Exception e)
{
LOG.warn(e);
}
}
public void inspect (Session session)
{
if (session == null)
return;
//check if the session is:
//1. valid
//2. expired
//3. passivatable
boolean passivate = false;
try (Lock lock = session.lock())
{
if (LOG.isDebugEnabled())
LOG.debug("Inspecting session {}, valid={}", session.getId(), session.isValid());
if (!session.isValid())
return; //do nothing, session is no longer valid
if (session.isExpiredAt(System.currentTimeMillis()))
{
_candidateSessionIdsForExpiry.add(session.getId());
if (LOG.isDebugEnabled())LOG.debug("Session {} is candidate for expiry", session.getId());
}
else if (_sessionStore.getIdlePassivationTimeoutSec() > 0 && session.isIdleLongerThan(_sessionStore.getIdlePassivationTimeoutSec()))
{
passivate = true;
if (LOG.isDebugEnabled())LOG.debug("Session {} will be passivated", session.getId());
}
}
if (passivate)
_sessionStore.passivateIdleSession(session.getId()); //TODO call passivate inside lock
}
@ -1048,6 +1132,33 @@ public class SessionManager extends ContainerLifeCycle implements org.eclipse.je
//Ask the session store
return _sessionStore.exists(id);
}
/* ------------------------------------------------------------ */
/**
* @return
*/
public Scheduler getScheduler()
{
return _scheduler;
}
/**
* @see java.lang.Object#toString()
*/
@Override
public String toString()
{
return (_context==null?super.toString():_context.toString());
}
@ -1193,4 +1304,5 @@ public class SessionManager extends ContainerLifeCycle implements org.eclipse.je
}
}
}
}

View File

@ -38,7 +38,9 @@ import org.eclipse.jetty.util.component.LifeCycle;
public interface SessionStore extends LifeCycle
{
void initialize(SessionContext context);
SessionManager getSessionManager();
Session newSession (HttpServletRequest request, String id, long time, long maxInactiveMs);
Session newSession (SessionData data);
Session renewSessionId (String oldId, String newId) throws Exception;
Session get(String id) throws Exception;
void put(String id, Session session) throws Exception;
@ -46,11 +48,8 @@ public interface SessionStore extends LifeCycle
Session delete (String id) throws Exception;
void shutdown ();
Set<String> checkExpiration (Set<String> candidates);
void inspect();
void setIdlePassivationTimeoutSec(int sec);
int getIdlePassivationTimeoutSec();
int getExpiryTimeoutSec();
void setExpiryTimeoutSec(int sec);
Stream<Session> getStream();
SessionDataStore getSessionDataStore();
void passivateIdleSession(String id);
}

View File

@ -41,16 +41,15 @@ public class SessionCookieTest
public class MockSessionStore extends AbstractSessionStore
{
/**
* @see org.eclipse.jetty.server.session.SessionStore#newSession(HttpServletRequest, String, long, long)
/**
* @param manager
*/
@Override
public Session newSession(HttpServletRequest request, String key, long time, long maxInactiveMs)
public MockSessionStore(SessionManager manager)
{
// TODO Auto-generated method stub
return null;
super(manager);
}
/**
* @see org.eclipse.jetty.server.session.SessionStore#shutdown()
*/
@ -101,15 +100,7 @@ public class SessionCookieTest
return null;
}
/**
* @see org.eclipse.jetty.server.session.SessionStore#getStream()
*/
@Override
public Stream<Session> getStream()
{
// TODO Auto-generated method stub
return null;
}
/**
* @see org.eclipse.jetty.server.session.AbstractSessionStore#doReplace(java.lang.String, org.eclipse.jetty.server.session.Session, org.eclipse.jetty.server.session.Session)
@ -121,6 +112,16 @@ public class SessionCookieTest
return false;
}
/**
* @see org.eclipse.jetty.server.session.AbstractSessionStore#newSession(javax.servlet.http.HttpServletRequest, org.eclipse.jetty.server.session.SessionData)
*/
@Override
public Session newSession(HttpServletRequest request, SessionData data)
{
// TODO Auto-generated method stub
return null;
}
}
@ -158,16 +159,7 @@ public class SessionCookieTest
}
}
public class MockSessionManager extends SessionManager
{
public MockSessionManager()
{
_sessionStore = new MockSessionStore();
((AbstractSessionStore)_sessionStore).setSessionDataStore(new NullSessionDataStore());
}
}
@Test
@ -176,7 +168,10 @@ public class SessionCookieTest
Server server = new Server();
MockSessionIdManager idMgr = new MockSessionIdManager(server);
idMgr.setWorkerName("node1");
MockSessionManager mgr = new MockSessionManager();
SessionManager mgr = new SessionManager();
MockSessionStore store = new MockSessionStore(mgr);
store.setSessionDataStore(new NullSessionDataStore());
mgr.setSessionStore(store);
mgr.setSessionIdManager(idMgr);
long now = System.currentTimeMillis();

View File

@ -122,12 +122,12 @@ public class FileTestServer extends AbstractTestServer
public FileTestServer(int port)
{
super(port, 30, 10,1,2);
super(port, 30, 10,2);
}
public FileTestServer(int port, int maxInactivePeriod, int scavengePeriod, int inspectPeriod, int idlePassivatePeriod)
public FileTestServer(int port, int maxInactivePeriod, int scavengePeriod, int idlePassivatePeriod)
{
super(port, maxInactivePeriod, scavengePeriod, inspectPeriod, idlePassivatePeriod);
super(port, maxInactivePeriod, scavengePeriod, idlePassivatePeriod);
}

View File

@ -48,9 +48,9 @@ public class IdleSessionTest extends AbstractIdleSessionTest
* @see org.eclipse.jetty.server.session.AbstractIdleSessionTest#createServer(int, int, int, int)
*/
@Override
public AbstractTestServer createServer(final int port, final int max, final int scavenge, int inspectPeriod, final int idleSec)
public AbstractTestServer createServer(final int port, final int max, final int scavenge, final int idleSec)
{
return new FileTestServer(port,max,scavenge, inspectPeriod, idleSec);
return new FileTestServer(port,max,scavenge, idleSec);
}

View File

@ -37,9 +37,9 @@ public class ImmortalSessionTest extends AbstractImmortalSessionTest
@Override
public AbstractTestServer createServer(int port, int max, int scavenge,int inspectionPeriod, int idlePassivatePeriod)
public AbstractTestServer createServer(int port, int max, int scavenge,int idlePassivatePeriod)
{
return new FileTestServer(port,max,scavenge, inspectionPeriod, idlePassivatePeriod);
return new FileTestServer(port,max,scavenge, idlePassivatePeriod);
}
}

View File

@ -40,9 +40,9 @@ public class NewSessionTest extends AbstractNewSessionTest
FileTestServer.teardown();
}
public AbstractTestServer createServer(int port, int max, int scavenge,int inspectionPeriod, int idlePassivatePeriod)
public AbstractTestServer createServer(int port, int max, int scavenge,int idlePassivatePeriod)
{
return new FileTestServer(port,max,scavenge,inspectionPeriod, idlePassivatePeriod);
return new FileTestServer(port,max,scavenge,idlePassivatePeriod);
}
@Test

View File

@ -39,9 +39,9 @@ public class OrphanedSessionTest extends AbstractOrphanedSessionTest
FileTestServer.teardown();
}
public AbstractTestServer createServer(int port, int max, int scavenge,int inspectionPeriod, int idlePassivatePeriod)
public AbstractTestServer createServer(int port, int max, int scavenge,int idlePassivatePeriod)
{
return new FileTestServer(port,max,scavenge,inspectionPeriod, idlePassivatePeriod);
return new FileTestServer(port,max,scavenge,idlePassivatePeriod);
}
@Test

View File

@ -50,9 +50,9 @@ public class ProxySerializationTest extends AbstractProxySerializationTest
* @see org.eclipse.jetty.server.session.AbstractProxySerializationTest#createServer(int, int, int)
*/
@Override
public AbstractTestServer createServer(int port, int max, int scavenge,int inspectionPeriod, int idlePassivatePeriod )
public AbstractTestServer createServer(int port, int max, int scavenge,int idlePassivatePeriod )
{
return new FileTestServer(port,max,scavenge, inspectionPeriod, idlePassivatePeriod);
return new FileTestServer(port,max,scavenge, idlePassivatePeriod);
}

View File

@ -41,9 +41,9 @@ public class ReentrantRequestSessionTest extends AbstractReentrantRequestSession
}
public AbstractTestServer createServer(int port, int max, int scavenge, int inspectionPeriod, int idlePassivatePeriod)
public AbstractTestServer createServer(int port, int max, int scavenge, int idlePassivatePeriod)
{
return new FileTestServer(port, max, scavenge, inspectionPeriod, idlePassivatePeriod);
return new FileTestServer(port, max, scavenge, idlePassivatePeriod);
}
@Test

View File

@ -38,9 +38,9 @@ public class RemoveSessionTest extends AbstractRemoveSessionTest
}
public AbstractTestServer createServer(int port, int max, int scavenge,int inspectionPeriod, int idlePassivatePeriod)
public AbstractTestServer createServer(int port, int max, int scavenge,int idlePassivatePeriod)
{
return new FileTestServer(port,max,scavenge,inspectionPeriod, idlePassivatePeriod);
return new FileTestServer(port,max,scavenge,idlePassivatePeriod);
}
@Test

View File

@ -40,9 +40,9 @@ public class SessionCookieTest extends AbstractSessionCookieTest
@Override
public AbstractTestServer createServer(int port, int max, int scavenge,int inspectionPeriod, int idlePassivatePeriod)
public AbstractTestServer createServer(int port, int max, int scavenge,int idlePassivatePeriod)
{
return new FileTestServer(port, max, scavenge,inspectionPeriod,idlePassivatePeriod);
return new FileTestServer(port, max, scavenge,idlePassivatePeriod);
}
}

View File

@ -38,9 +38,9 @@ public class SessionInvalidateAndCreateTest extends AbstractSessionInvalidateAnd
}
@Override
public AbstractTestServer createServer(int port, int max, int scavenge,int inspectionPeriod, int idlePassivatePeriod)
public AbstractTestServer createServer(int port, int max, int scavenge,int idlePassivatePeriod)
{
return new FileTestServer(port,max,scavenge,inspectionPeriod,idlePassivatePeriod);
return new FileTestServer(port,max,scavenge,idlePassivatePeriod);
}
@Test

View File

@ -44,9 +44,9 @@ public class SessionRenewTest extends AbstractSessionRenewTest
}
@Override
public AbstractTestServer createServer(int port, int max, int scavenge,int inspectionPeriod, int idlePassivatePeriod)
public AbstractTestServer createServer(int port, int max, int scavenge,int idlePassivatePeriod)
{
return new FileTestServer(port, max, scavenge,inspectionPeriod,idlePassivatePeriod);
return new FileTestServer(port, max, scavenge,idlePassivatePeriod);
}
@Test

View File

@ -38,9 +38,9 @@ public class SessionValueSharedSaving extends AbstractSessionValueSavingTest
@Override
public AbstractTestServer createServer(int port, int max, int scavenge,int inspectionPeriod, int idlePassivatePeriod)
public AbstractTestServer createServer(int port, int max, int scavenge,int idlePassivatePeriod)
{
return new FileTestServer(port,max,scavenge,inspectionPeriod,idlePassivatePeriod);
return new FileTestServer(port,max,scavenge,idlePassivatePeriod);
}
}

View File

@ -39,7 +39,6 @@ public class GCloudTestServer extends AbstractTestServer
{
static protected int __maxInactivePeriod = 30;
static protected int __scavengePeriod = 10;
static protected int __inspectPeriod = 1;
static protected int __idlePeriod = 2;
@ -50,9 +49,9 @@ public class GCloudTestServer extends AbstractTestServer
* @param scavengePeriod
* @param sessionIdMgrConfig
*/
public GCloudTestServer(int port, int maxInactivePeriod, int scavengePeriod, int inspectPeriod, int idlePassivatePeriod, GCloudConfiguration config)
public GCloudTestServer(int port, int maxInactivePeriod, int scavengePeriod, int idlePassivatePeriod, GCloudConfiguration config)
{
super(port, maxInactivePeriod, scavengePeriod, inspectPeriod, idlePassivatePeriod, config);
super(port, maxInactivePeriod, scavengePeriod, idlePassivatePeriod, config);
}
/**
@ -61,7 +60,7 @@ public class GCloudTestServer extends AbstractTestServer
*/
public GCloudTestServer(int port, GCloudConfiguration configuration)
{
super(port, 30,10, __inspectPeriod, __idlePeriod, configuration);
super(port, 30,10, __idlePeriod, configuration);
}

View File

@ -53,9 +53,9 @@ public class ImmortalSessionTest extends AbstractImmortalSessionTest
* @see org.eclipse.jetty.server.session.AbstractImmortalSessionTest#createServer(int, int, int)
*/
@Override
public AbstractTestServer createServer(int port, int maxInactiveMs, int scavengeMs,int inspectionPeriod, int idlePassivatePeriod)
public AbstractTestServer createServer(int port, int maxInactiveMs, int scavengeMs,int idlePassivatePeriod)
{
return new GCloudTestServer(port, maxInactiveMs, scavengeMs, inspectionPeriod, idlePassivatePeriod,_testSupport.getConfiguration());
return new GCloudTestServer(port, maxInactiveMs, scavengeMs, idlePassivatePeriod, _testSupport.getConfiguration());
}
@Test

View File

@ -53,9 +53,9 @@ public class InvalidationSessionTest extends AbstractInvalidationSessionTest
* @see org.eclipse.jetty.server.session.AbstractInvalidationSessionTest#createServer(int)
*/
@Override
public AbstractTestServer createServer(int port, int maxInactive, int scavengeInterval, int inspectInterval, int idlePassivateInterval)
public AbstractTestServer createServer(int port, int maxInactive, int scavengeInterval, int idlePassivateInterval)
{
GCloudTestServer server = new GCloudTestServer(port, maxInactive, scavengeInterval, inspectInterval, idlePassivateInterval,_testSupport.getConfiguration())
GCloudTestServer server = new GCloudTestServer(port, maxInactive, scavengeInterval, idlePassivateInterval, _testSupport.getConfiguration())
{
/**
* @see org.eclipse.jetty.gcloud.session.GCloudTestServer#newSessionManager()

View File

@ -50,9 +50,9 @@ public class LastAccessTimeTest extends AbstractLastAccessTimeTest
* @see org.eclipse.jetty.server.session.AbstractLastAccessTimeTest#createServer(int, int, int)
*/
@Override
public AbstractTestServer createServer(int port, int max, int scavenge,int inspectionPeriod, int idlePassivatePeriod)
public AbstractTestServer createServer(int port, int max, int scavenge,int idlePassivatePeriod)
{
return new GCloudTestServer(port, max, scavenge, inspectionPeriod, idlePassivatePeriod, _testSupport.getConfiguration());
return new GCloudTestServer(port, max, scavenge, idlePassivatePeriod, _testSupport.getConfiguration());
}
@Test

View File

@ -51,9 +51,9 @@ public class LocalSessionScavengingTest extends AbstractLocalSessionScavengingTe
* @see org.eclipse.jetty.server.session.AbstractLocalSessionScavengingTest#createServer(int, int, int)
*/
@Override
public AbstractTestServer createServer(int port, int max, int scavenge,int inspectionPeriod, int idlePassivatePeriod)
public AbstractTestServer createServer(int port, int max, int scavenge,int idlePassivatePeriod)
{
return new GCloudTestServer(port, max, scavenge, inspectionPeriod, idlePassivatePeriod, _testSupport.getConfiguration());
return new GCloudTestServer(port, max, scavenge, idlePassivatePeriod, _testSupport.getConfiguration());
}
@Test

View File

@ -57,9 +57,9 @@ public class NewSessionTest extends AbstractNewSessionTest
* @see org.eclipse.jetty.server.session.AbstractNewSessionTest#createServer(int, int, int)
*/
@Override
public AbstractTestServer createServer(int port, int max, int scavenge,int inspectionPeriod, int idlePassivatePeriod)
public AbstractTestServer createServer(int port, int max, int scavenge,int idlePassivatePeriod)
{
return new GCloudTestServer(port, max, scavenge, inspectionPeriod, idlePassivatePeriod, _testSupport.getConfiguration());
return new GCloudTestServer(port, max, scavenge, idlePassivatePeriod, _testSupport.getConfiguration());
}
@Test

View File

@ -52,9 +52,9 @@ public class OrphanedSessionTest extends AbstractOrphanedSessionTest
* @see org.eclipse.jetty.server.session.AbstractOrphanedSessionTest#createServer(int, int, int)
*/
@Override
public AbstractTestServer createServer(int port, int max, int scavenge,int inspectionPeriod, int idlePassivatePeriod)
public AbstractTestServer createServer(int port, int max, int scavenge,int idlePassivatePeriod)
{
return new GCloudTestServer(port, max, scavenge, inspectionPeriod, idlePassivatePeriod, _testSupport.getConfiguration());
return new GCloudTestServer(port, max, scavenge, idlePassivatePeriod, _testSupport.getConfiguration());
}
@Test

View File

@ -51,9 +51,9 @@ public class ReentrantRequestSessionTest extends AbstractReentrantRequestSession
* @see org.eclipse.jetty.server.session.AbstractReentrantRequestSessionTest#createServer(int)
*/
@Override
public AbstractTestServer createServer(int port,int max, int scavengePeriod,int inspectionPeriod, int idlePassivatePeriod)
public AbstractTestServer createServer(int port,int max, int scavengePeriod,int idlePassivatePeriod)
{
return new GCloudTestServer(port, max, scavengePeriod, inspectionPeriod, idlePassivatePeriod, _testSupport.getConfiguration());
return new GCloudTestServer(port, max, scavengePeriod, idlePassivatePeriod, _testSupport.getConfiguration());
}
@Test

View File

@ -54,9 +54,9 @@ public class RemoveSessionTest extends AbstractRemoveSessionTest
* @see org.eclipse.jetty.server.session.AbstractRemoveSessionTest#createServer(int, int, int)
*/
@Override
public AbstractTestServer createServer(int port, int max, int scavenge,int inspectionPeriod, int idlePassivatePeriod)
public AbstractTestServer createServer(int port, int max, int scavenge,int idlePassivatePeriod)
{
return new GCloudTestServer(port, max, scavenge, inspectionPeriod, idlePassivatePeriod, _testSupport.getConfiguration());
return new GCloudTestServer(port, max, scavenge, idlePassivatePeriod, _testSupport.getConfiguration());
}
@Test

View File

@ -50,12 +50,12 @@ public class SameNodeLoadTest extends AbstractSameNodeLoadTest
/**
* @see org.eclipse.jetty.server.session.AbstractSameNodeLoadTest#createServer(int, int, int, int, int)
* @see org.eclipse.jetty.server.session.AbstractSameNodeLoadTest#createServer(int, int, int, int)
*/
@Override
public AbstractTestServer createServer(int port, int max, int scavenge, int inspectionPeriod, int idlePassivationPeriod)
public AbstractTestServer createServer(int port, int max, int scavenge, int idlePassivationPeriod)
{
return new GCloudTestServer(port, max, scavenge, inspectionPeriod, idlePassivationPeriod, _testSupport.getConfiguration());
return new GCloudTestServer(port, max, scavenge, idlePassivationPeriod, _testSupport.getConfiguration());
}
@Test

View File

@ -57,9 +57,9 @@ public class SessionExpiryTest extends AbstractSessionExpiryTest
* @see org.eclipse.jetty.server.session.AbstractSessionExpiryTest#createServer(int, int, int)
*/
@Override
public AbstractTestServer createServer(int port, int max, int scavenge, int inspectionPeriod, int idlePassivationPeriod)
public AbstractTestServer createServer(int port, int max, int scavenge, int idlePassivationPeriod)
{
return new GCloudTestServer(port, max, scavenge, inspectionPeriod, idlePassivationPeriod,_testSupport.getConfiguration());
return new GCloudTestServer(port, max, scavenge, idlePassivationPeriod, _testSupport.getConfiguration());
}
@Test

View File

@ -53,9 +53,9 @@ public class SessionInvalidateAndCreateTest extends AbstractSessionInvalidateAnd
* @see org.eclipse.jetty.server.session.AbstractSessionInvalidateAndCreateTest#createServer(int, int, int)
*/
@Override
public AbstractTestServer createServer(int port, int max, int scavenge, int inspectionPeriod, int idlePassivationPeriod)
public AbstractTestServer createServer(int port, int max, int scavenge, int idlePassivationPeriod)
{
return new GCloudTestServer(port, max, scavenge, inspectionPeriod, idlePassivationPeriod,_testSupport.getConfiguration());
return new GCloudTestServer(port, max, scavenge, idlePassivationPeriod, _testSupport.getConfiguration());
}
@Test

View File

@ -56,9 +56,9 @@ public class SessionRenewTest extends AbstractSessionRenewTest
* @see org.eclipse.jetty.server.session.AbstractSessionRenewTest#createServer(int, int, int)
*/
@Override
public AbstractTestServer createServer(int port, int max, int scavenge, int inspectionPeriod, int idlePassivationPeriod)
public AbstractTestServer createServer(int port, int max, int scavenge, int idlePassivationPeriod)
{
return new GCloudTestServer(port,max, scavenge, inspectionPeriod, idlePassivationPeriod,_testSupport.getConfiguration());
return new GCloudTestServer(port,max, scavenge, idlePassivationPeriod, _testSupport.getConfiguration());
}
@Test

View File

@ -52,9 +52,9 @@ public class SessionValueSavingTest extends AbstractSessionValueSavingTest
* @see org.eclipse.jetty.server.session.AbstractSessionValueSavingTest#createServer(int, int, int)
*/
@Override
public AbstractTestServer createServer(int port, int max, int scavenge, int inspectionPeriod, int idlePassivationPeriod)
public AbstractTestServer createServer(int port, int max, int scavenge, int idlePassivationPeriod)
{
return new GCloudTestServer(port, max, scavenge, inspectionPeriod, idlePassivationPeriod,_testSupport.getConfiguration());
return new GCloudTestServer(port, max, scavenge, idlePassivationPeriod, _testSupport.getConfiguration());
}
@Test

View File

@ -30,12 +30,12 @@ public class HashTestServer extends AbstractTestServer
public HashTestServer(int port)
{
super(port, 30, 10, 1, 2);
super(port, 30, 10, 2);
}
public HashTestServer(int port, int maxInactivePeriod, int scavengePeriod, int inspectPeriod, int idlePassivatePeriod)
public HashTestServer(int port, int maxInactivePeriod, int scavengePeriod, int idlePassivatePeriod)
{
super(port, maxInactivePeriod, scavengePeriod, inspectPeriod, idlePassivatePeriod);
super(port, maxInactivePeriod, scavengePeriod, idlePassivatePeriod);
}

View File

@ -22,9 +22,9 @@ public class ImmortalSessionTest extends AbstractImmortalSessionTest
{
@Override
public AbstractTestServer createServer(int port, int max, int scavenge, int inspectionPeriod, int idlePassivationPeriod)
public AbstractTestServer createServer(int port, int max, int scavenge, int idlePassivationPeriod)
{
return new HashTestServer(port,max,scavenge,inspectionPeriod, idlePassivationPeriod);
return new HashTestServer(port,max,scavenge,idlePassivationPeriod);
}
}

View File

@ -26,9 +26,9 @@ import org.junit.Test;
public class NewSessionTest extends AbstractNewSessionTest
{
public AbstractTestServer createServer(int port, int max, int scavenge, int inspectionPeriod, int idlePassivationPeriod)
public AbstractTestServer createServer(int port, int max, int scavenge, int idlePassivationPeriod)
{
return new HashTestServer(port,max,scavenge,inspectionPeriod,idlePassivationPeriod);
return new HashTestServer(port,max,scavenge,idlePassivationPeriod);
}
@Test

View File

@ -27,12 +27,12 @@ public class ReentrantRequestSessionTest extends AbstractReentrantRequestSession
{
/**
* @see org.eclipse.jetty.server.session.AbstractReentrantRequestSessionTest#createServer(int, int, int, int, int)
* @see org.eclipse.jetty.server.session.AbstractReentrantRequestSessionTest#createServer(int, int, int, int)
*/
@Override
public AbstractTestServer createServer(int port, int max, int scavenge, int inspectionPeriod, int idlePassivatePeriod)
public AbstractTestServer createServer(int port, int max, int scavenge, int idlePassivatePeriod)
{
return new HashTestServer(port, max, scavenge, inspectionPeriod, idlePassivatePeriod);
return new HashTestServer(port, max, scavenge, idlePassivatePeriod);
}
@Test

View File

@ -31,12 +31,12 @@ public class RemoveSessionTest extends AbstractRemoveSessionTest
}
/**
* @see org.eclipse.jetty.server.session.AbstractRemoveSessionTest#createServer(int, int, int, int, int)
* @see org.eclipse.jetty.server.session.AbstractRemoveSessionTest#createServer(int, int, int, int)
*/
@Override
public AbstractTestServer createServer(int port, int max, int scavenge, int inspectionPeriod, int idlePassivationPeriod)
public AbstractTestServer createServer(int port, int max, int scavenge, int idlePassivationPeriod)
{
return new HashTestServer (port, max, scavenge, inspectionPeriod, idlePassivationPeriod);
return new HashTestServer (port, max, scavenge, idlePassivationPeriod);
}
}

View File

@ -22,9 +22,9 @@ public class SessionCookieTest extends AbstractSessionCookieTest
{
@Override
public AbstractTestServer createServer(int port, int max, int scavenge, int inspectionPeriod, int idlePassivationPeriod)
public AbstractTestServer createServer(int port, int max, int scavenge, int idlePassivationPeriod)
{
return new HashTestServer(port, max, scavenge, inspectionPeriod, idlePassivationPeriod);
return new HashTestServer(port, max, scavenge, idlePassivationPeriod);
}
}

View File

@ -24,9 +24,9 @@ public class SessionInvalidateAndCreateTest extends AbstractSessionInvalidateAnd
{
@Override
public AbstractTestServer createServer(int port, int max, int scavenge, int inspectionPeriod, int idlePassivationPeriod)
public AbstractTestServer createServer(int port, int max, int scavenge, int idlePassivationPeriod)
{
return new HashTestServer(port,max,scavenge,inspectionPeriod, idlePassivationPeriod);
return new HashTestServer(port,max,scavenge,idlePassivationPeriod);
}
@Test

View File

@ -31,9 +31,9 @@ public class SessionRenewTest extends AbstractSessionRenewTest
{
@Override
public AbstractTestServer createServer(int port, int max, int scavenge, int inspectionPeriod, int idlePassivationPeriod)
public AbstractTestServer createServer(int port, int max, int scavenge, int idlePassivationPeriod)
{
return new HashTestServer(port, max, scavenge,inspectionPeriod, idlePassivationPeriod);
return new HashTestServer(port, max, scavenge,idlePassivationPeriod);
}
@Test

View File

@ -22,9 +22,9 @@ public class SessionValueSharedSaving extends AbstractSessionValueSavingTest
{
@Override
public AbstractTestServer createServer(int port, int max, int scavenge, int inspectionPeriod, int idlePassivationPeriod)
public AbstractTestServer createServer(int port, int max, int scavenge, int idlePassivationPeriod)
{
return new HashTestServer(port,max,scavenge,inspectionPeriod, idlePassivationPeriod);
return new HashTestServer(port,max,scavenge,idlePassivationPeriod);
}
}

View File

@ -56,9 +56,9 @@ public class ImmortalSessionTest extends AbstractImmortalSessionTest
* @see org.eclipse.jetty.server.session.AbstractImmortalSessionTest#createServer(int, int, int)
*/
@Override
public AbstractTestServer createServer(int port, int maxInactiveMs, int scavenge, int inspectInterval, int idlePassivateInterval)
public AbstractTestServer createServer(int port, int maxInactiveMs, int scavenge, int idlePassivateInterval)
{
return new InfinispanTestSessionServer(port, maxInactiveMs, scavenge, inspectInterval, idlePassivateInterval,__testSupport.getCache());
return new InfinispanTestSessionServer(port, maxInactiveMs, scavenge, idlePassivateInterval, __testSupport.getCache());
}
@Override

View File

@ -34,14 +34,14 @@ public class InfinispanTestSessionServer extends AbstractTestServer
public InfinispanTestSessionServer(int port, BasicCache config)
{
this(port, 30, 10, 1, 2, config);
this(port, 30, 10, 2, config);
}
public InfinispanTestSessionServer(int port, int maxInactivePeriod, int scavengePeriod, int inspectPeriod, int idlePassivatePeriod, BasicCache config)
public InfinispanTestSessionServer(int port, int maxInactivePeriod, int scavengePeriod, int idlePassivatePeriod, BasicCache config)
{
super(port, maxInactivePeriod, scavengePeriod, inspectPeriod, idlePassivatePeriod, config);
super(port, maxInactivePeriod, scavengePeriod, idlePassivatePeriod, config);
}

View File

@ -42,9 +42,9 @@ public class LastAccessTimeTest extends AbstractLastAccessTimeTest
@Override
public AbstractTestServer createServer(int port, int max, int scavenge, int inspectInterval, int idlePassivateInterval)
public AbstractTestServer createServer(int port, int max, int scavenge, int idlePassivateInterval)
{
return new InfinispanTestSessionServer(port, max, scavenge, inspectInterval, idlePassivateInterval, __testSupport.getCache());
return new InfinispanTestSessionServer(port, max, scavenge, idlePassivateInterval, __testSupport.getCache());
}
@Override

View File

@ -51,9 +51,9 @@ public class LocalSessionScavengingTest extends AbstractLocalSessionScavengingTe
* @see org.eclipse.jetty.server.session.AbstractLocalSessionScavengingTest#createServer(int, int, int)
*/
@Override
public AbstractTestServer createServer(int port, int max, int scavenge, int inspectInterval, int idlePassivateInterval)
public AbstractTestServer createServer(int port, int max, int scavenge, int idlePassivateInterval)
{
return new InfinispanTestSessionServer(port, max, scavenge, inspectInterval, idlePassivateInterval, __testSupport.getCache());
return new InfinispanTestSessionServer(port, max, scavenge, idlePassivateInterval, __testSupport.getCache());
}
}

View File

@ -50,9 +50,9 @@ public class NewSessionTest extends AbstractNewSessionTest
* @see org.eclipse.jetty.server.session.AbstractNewSessionTest#createServer(int, int, int)
*/
@Override
public AbstractTestServer createServer(int port, int max, int scavenge, int inspectInterval, int idlePassivateInterval)
public AbstractTestServer createServer(int port, int max, int scavenge, int idlePassivateInterval)
{
return new InfinispanTestSessionServer(port, max, scavenge, inspectInterval, idlePassivateInterval, __testSupport.getCache());
return new InfinispanTestSessionServer(port, max, scavenge, idlePassivateInterval, __testSupport.getCache());
}

View File

@ -49,9 +49,9 @@ public class ReentrantRequestSessionTest extends AbstractReentrantRequestSession
* @see org.eclipse.jetty.server.session.AbstractReentrantRequestSessionTest#createServer(int)
*/
@Override
public AbstractTestServer createServer(int port,int maxInactive, int scavenge, int inspectInterval, int idlePassivateInterval)
public AbstractTestServer createServer(int port,int maxInactive, int scavenge, int idlePassivateInterval)
{
return new InfinispanTestSessionServer(port, maxInactive, scavenge, inspectInterval, idlePassivateInterval,__testSupport.getCache());
return new InfinispanTestSessionServer(port, maxInactive, scavenge, idlePassivateInterval, __testSupport.getCache());
}
@Override

View File

@ -43,9 +43,9 @@ public class RemoveSessionTest extends AbstractRemoveSessionTest
@Override
public AbstractTestServer createServer(int port, int max, int scavenge, int inspectInterval, int idlePassivateInterval)
public AbstractTestServer createServer(int port, int max, int scavenge, int idlePassivateInterval)
{
InfinispanTestSessionServer s = new InfinispanTestSessionServer(port, max, scavenge, inspectInterval, idlePassivateInterval,__testSupport.getCache());
InfinispanTestSessionServer s = new InfinispanTestSessionServer(port, max, scavenge, idlePassivateInterval, __testSupport.getCache());
return s;
}

View File

@ -51,9 +51,9 @@ public class SameNodeLoadTest extends AbstractSameNodeLoadTest
* @see org.eclipse.jetty.server.session.AbstractSameNodeLoadTest#createServer(int)
*/
@Override
public AbstractTestServer createServer(int port,int maxInactive, int scavenge, int inspectInterval, int idlePassivateInterval)
public AbstractTestServer createServer(int port,int maxInactive, int scavenge, int idlePassivateInterval)
{
InfinispanTestSessionServer server = new InfinispanTestSessionServer(port,maxInactive, scavenge, inspectInterval, idlePassivateInterval, __testSupport.getCache());
InfinispanTestSessionServer server = new InfinispanTestSessionServer(port,maxInactive, scavenge, idlePassivateInterval, __testSupport.getCache());
return server;
}

View File

@ -42,9 +42,9 @@ public class SessionExpiryTest extends AbstractSessionExpiryTest
}
@Override
public AbstractTestServer createServer(int port, int max, int scavenge, int inspectInterval, int idlePassivateInterval)
public AbstractTestServer createServer(int port, int max, int scavenge, int idlePassivateInterval)
{
InfinispanTestSessionServer server = new InfinispanTestSessionServer(port, max, scavenge, inspectInterval, idlePassivateInterval, __testSupport.getCache());
InfinispanTestSessionServer server = new InfinispanTestSessionServer(port, max, scavenge, idlePassivateInterval, __testSupport.getCache());
return server;
}

View File

@ -50,9 +50,9 @@ public class SessionInvalidateAndCreateTest extends AbstractSessionInvalidateAnd
* @see org.eclipse.jetty.server.session.AbstractSessionInvalidateAndCreateTest#createServer(int, int, int)
*/
@Override
public AbstractTestServer createServer(int port, int max, int scavenge, int inspectInterval, int idlePassivateInterval)
public AbstractTestServer createServer(int port, int max, int scavenge, int idlePassivateInterval)
{
return new InfinispanTestSessionServer(port, max, scavenge, inspectInterval, idlePassivateInterval,__testSupport.getCache());
return new InfinispanTestSessionServer(port, max, scavenge, idlePassivateInterval, __testSupport.getCache());
}
@Override

View File

@ -57,9 +57,9 @@ public class SessionRenewTest extends AbstractSessionRenewTest
* @see org.eclipse.jetty.server.session.AbstractSessionRenewTest#createServer(int, int, int)
*/
@Override
public AbstractTestServer createServer(int port, int max, int scavenge, int inspectInterval, int idlePassivateInterval)
public AbstractTestServer createServer(int port, int max, int scavenge, int idlePassivateInterval)
{
return new InfinispanTestSessionServer(port, max, scavenge, inspectInterval, idlePassivateInterval, __testSupport.getCache());
return new InfinispanTestSessionServer(port, max, scavenge, idlePassivateInterval, __testSupport.getCache());
}
@Test

View File

@ -59,9 +59,9 @@ public class RemoteImmortalSessionTest extends AbstractImmortalSessionTest
* @see org.eclipse.jetty.server.session.AbstractImmortalSessionTest#createServer(int, int, int)
*/
@Override
public AbstractTestServer createServer(int port, int maxInactiveMs, int scavenge, int inspectInterval, int idlePassivateInterval)
public AbstractTestServer createServer(int port, int maxInactiveMs, int scavenge, int idlePassivateInterval)
{
return new InfinispanTestSessionServer(port, maxInactiveMs, scavenge, inspectInterval, idlePassivateInterval,__testSupport.getCache());
return new InfinispanTestSessionServer(port, maxInactiveMs, scavenge, idlePassivateInterval, __testSupport.getCache());
}
@Override

View File

@ -58,9 +58,9 @@ public class RemoteInvalidationSessionTest extends AbstractInvalidationSessionTe
* @see org.eclipse.jetty.server.session.AbstractInvalidationSessionTest#createServer(int)
*/
@Override
public AbstractTestServer createServer(int port, int maxInterval, int scavengeInterval, int inspectInterval, int idlePassivateInterval)
public AbstractTestServer createServer(int port, int maxInterval, int scavengeInterval, int idlePassivateInterval)
{
return new InfinispanTestSessionServer(port, maxInterval, scavengeInterval, inspectInterval, idlePassivateInterval,__testSupport.getCache());
return new InfinispanTestSessionServer(port, maxInterval, scavengeInterval, idlePassivateInterval, __testSupport.getCache());
}

View File

@ -52,9 +52,9 @@ public class RemoteLastAccessTimeTest extends AbstractLastAccessTimeTest
@Override
public AbstractTestServer createServer(int port, int max, int scavenge, int inspectInterval, int idlePassivateInterval)
public AbstractTestServer createServer(int port, int max, int scavenge, int idlePassivateInterval)
{
return new InfinispanTestSessionServer(port, max, scavenge, inspectInterval, idlePassivateInterval,__testSupport.getCache());
return new InfinispanTestSessionServer(port, max, scavenge, idlePassivateInterval, __testSupport.getCache());
}
@Override

View File

@ -53,9 +53,9 @@ public class RemoteLocalSessionScavengingTest extends AbstractLocalSessionScaven
* @see org.eclipse.jetty.server.session.AbstractLocalSessionScavengingTest#createServer(int, int, int)
*/
@Override
public AbstractTestServer createServer(int port, int max, int scavenge, int inspectInterval, int idlePassivateInterval)
public AbstractTestServer createServer(int port, int max, int scavenge, int idlePassivateInterval)
{
return new InfinispanTestSessionServer(port, max, scavenge, inspectInterval, idlePassivateInterval,__testSupport.getCache());
return new InfinispanTestSessionServer(port, max, scavenge, idlePassivateInterval, __testSupport.getCache());
}
}

View File

@ -53,9 +53,9 @@ public class RemoteNewSessionTest extends AbstractNewSessionTest
* @see org.eclipse.jetty.server.session.AbstractNewSessionTest#createServer(int, int, int)
*/
@Override
public AbstractTestServer createServer(int port, int max, int scavenge, int inspectInterval, int idlePassivateInterval)
public AbstractTestServer createServer(int port, int max, int scavenge, int idlePassivateInterval)
{
return new InfinispanTestSessionServer(port, max, scavenge, inspectInterval, idlePassivateInterval, __testSupport.getCache());
return new InfinispanTestSessionServer(port, max, scavenge, idlePassivateInterval, __testSupport.getCache());
}

View File

@ -52,9 +52,9 @@ public class RemoteReentrantRequestSessionTest extends AbstractReentrantRequestS
* @see org.eclipse.jetty.server.session.AbstractReentrantRequestSessionTest#createServer(int)
*/
@Override
public AbstractTestServer createServer(int port, int maxInactive, int scavenge, int inspectInterval, int idlePassivateInterval)
public AbstractTestServer createServer(int port, int maxInactive, int scavenge, int idlePassivateInterval)
{
return new InfinispanTestSessionServer(port, maxInactive, scavenge, inspectInterval, idlePassivateInterval, __testSupport.getCache());
return new InfinispanTestSessionServer(port, maxInactive, scavenge, idlePassivateInterval, __testSupport.getCache());
}
@Override

View File

@ -46,9 +46,9 @@ public class RemoteRemoveSessionTest extends AbstractRemoveSessionTest
@Override
public AbstractTestServer createServer(int port, int max, int scavenge, int inspectInterval, int idlePassivateInterval)
public AbstractTestServer createServer(int port, int max, int scavenge, int idlePassivateInterval)
{
InfinispanTestSessionServer s = new InfinispanTestSessionServer(port, max, scavenge,inspectInterval, idlePassivateInterval, __testSupport.getCache());
InfinispanTestSessionServer s = new InfinispanTestSessionServer(port, max, scavenge,idlePassivateInterval, __testSupport.getCache());
return s;
}

View File

@ -54,9 +54,9 @@ public class RemoteSameNodeLoadTest extends AbstractSameNodeLoadTest
* @see org.eclipse.jetty.server.session.AbstractSameNodeLoadTest#createServer(int)
*/
@Override
public AbstractTestServer createServer(int port, int maxInactive, int scavenge, int inspectInterval, int idlePassivateInterval)
public AbstractTestServer createServer(int port, int maxInactive, int scavenge, int idlePassivateInterval)
{
InfinispanTestSessionServer server = new InfinispanTestSessionServer(port, maxInactive, scavenge,inspectInterval, idlePassivateInterval, __testSupport.getCache());
InfinispanTestSessionServer server = new InfinispanTestSessionServer(port, maxInactive, scavenge,idlePassivateInterval, __testSupport.getCache());
return server;
}

View File

@ -45,9 +45,9 @@ public class RemoteSessionExpiryTest extends AbstractSessionExpiryTest
}
@Override
public AbstractTestServer createServer(int port, int max, int scavenge, int inspectInterval, int idlePassivateInterval)
public AbstractTestServer createServer(int port, int max, int scavenge, int idlePassivateInterval)
{
InfinispanTestSessionServer server = new InfinispanTestSessionServer(port, max, scavenge, inspectInterval, idlePassivateInterval,__testSupport.getCache());
InfinispanTestSessionServer server = new InfinispanTestSessionServer(port, max, scavenge, idlePassivateInterval, __testSupport.getCache());
return server;
}

View File

@ -53,9 +53,9 @@ public class RemoteSessionInvalidateAndCreateTest extends AbstractSessionInvalid
* @see org.eclipse.jetty.server.session.AbstractSessionInvalidateAndCreateTest#createServer(int, int, int)
*/
@Override
public AbstractTestServer createServer(int port, int max, int scavenge, int inspectInterval, int idlePassivateInterval)
public AbstractTestServer createServer(int port, int max, int scavenge, int idlePassivateInterval)
{
return new InfinispanTestSessionServer(port, max, scavenge, inspectInterval, idlePassivateInterval,__testSupport.getCache());
return new InfinispanTestSessionServer(port, max, scavenge, idlePassivateInterval, __testSupport.getCache());
}
@Override

View File

@ -56,9 +56,9 @@ public class RemoteSessionRenewTest extends AbstractSessionRenewTest
* @see org.eclipse.jetty.server.session.AbstractSessionRenewTest#createServer(int, int, int)
*/
@Override
public AbstractTestServer createServer(int port, int max, int scavenge, int inspectInterval, int idlePassivateInterval)
public AbstractTestServer createServer(int port, int max, int scavenge, int idlePassivateInterval)
{
return new InfinispanTestSessionServer(port, max, scavenge, inspectInterval, idlePassivateInterval,__testSupport.getCache());
return new InfinispanTestSessionServer(port, max, scavenge, idlePassivateInterval, __testSupport.getCache());
}
@Test

View File

@ -63,7 +63,7 @@ public class DirtyAttributeTest
@Test
public void testDirtyWrite() throws Exception
{
AbstractTestServer server = new JdbcTestServer(0,INACTIVE,SCAVENGE, INSPECT, IDLE_PASSIVATE);
AbstractTestServer server = new JdbcTestServer(0,INACTIVE,SCAVENGE, IDLE_PASSIVATE);
ServletContextHandler ctxA = server.addContext("/mod");
ctxA.addServlet(TestDirtyServlet.class, "/test");

View File

@ -29,9 +29,9 @@ import org.junit.Test;
public class ImmortalSessionTest extends AbstractImmortalSessionTest
{
public AbstractTestServer createServer(int port, int maxInactiveMs, int scavengeMs, int inspect, int idlePassivate)
public AbstractTestServer createServer(int port, int maxInactiveMs, int scavengeMs, int idlePassivate)
{
return new JdbcTestServer(port, maxInactiveMs, scavengeMs, inspect, idlePassivate);
return new JdbcTestServer(port, maxInactiveMs, scavengeMs, idlePassivate);
}
@Test

View File

@ -29,9 +29,9 @@ public class InvalidationSessionTest extends AbstractInvalidationSessionTest
{
public static final int IDLE_PASSIVATE_SEC = 3;
public AbstractTestServer createServer(int port, int maxInactive, int scavengeInterval, int inspectInterval, int idlePassivateInterval)
public AbstractTestServer createServer(int port, int maxInactive, int scavengeInterval, int idlePassivateInterval)
{
return new JdbcTestServer(port, maxInactive, scavengeInterval, inspectInterval, idlePassivateInterval);
return new JdbcTestServer(port, maxInactive, scavengeInterval, idlePassivateInterval);
}
public void pause()

View File

@ -85,14 +85,14 @@ public class JdbcTestServer extends AbstractTestServer
super(port);
}
public JdbcTestServer(int port, int maxInactivePeriod, int scavengePeriod, int inspectPeriod, int idlePassivatePeriod, String connectionUrl)
public JdbcTestServer(int port, int maxInactivePeriod, int scavengePeriod, int idlePassivatePeriod, String connectionUrl)
{
super(port, maxInactivePeriod, scavengePeriod, inspectPeriod, idlePassivatePeriod, connectionUrl);
super(port, maxInactivePeriod, scavengePeriod, idlePassivatePeriod, connectionUrl);
}
public JdbcTestServer(int port, int maxInactivePeriod, int scavengePeriod, int inspectPeriod, int idlePassivatePeriod)
public JdbcTestServer(int port, int maxInactivePeriod, int scavengePeriod, int idlePassivatePeriod)
{
super(port, maxInactivePeriod, scavengePeriod, inspectPeriod, idlePassivatePeriod, DEFAULT_CONNECTION_URL);
super(port, maxInactivePeriod, scavengePeriod, idlePassivatePeriod, DEFAULT_CONNECTION_URL);
}
@ -117,7 +117,7 @@ public class JdbcTestServer extends AbstractTestServer
{
JDBCSessionManager manager = new JDBCSessionManager();
JDBCSessionDataStore ds = manager.getSessionDataStore();
ds.setGracePeriodSec(_inspectionPeriod);
ds.setGracePeriodSec(_scavengePeriod);
DatabaseAdaptor da = new DatabaseAdaptor();
da.setDriverInfo(DRIVER_CLASS, (_config==null?DEFAULT_CONNECTION_URL:(String)_config));
ds.setDatabaseAdaptor(da);

View File

@ -26,9 +26,9 @@ import org.junit.Test;
*/
public class LastAccessTimeTest extends AbstractLastAccessTimeTest
{
public AbstractTestServer createServer(int port, int max, int scavenge, int inspect, int idlePassivate)
public AbstractTestServer createServer(int port, int max, int scavenge, int idlePassivate)
{
return new JdbcTestServer(port,max,scavenge, inspect, idlePassivate);
return new JdbcTestServer(port,max,scavenge, idlePassivate);
}
@Test

View File

@ -43,9 +43,9 @@ public class LocalSessionScavengingTest extends AbstractLocalSessionScavengingTe
}
}
public AbstractTestServer createServer(int port, int max, int scavenge, int inspect, int idlePassivate)
public AbstractTestServer createServer(int port, int max, int scavenge, int idlePassivate)
{
return new JdbcTestServer(port,max,scavenge, inspect, idlePassivate);
return new JdbcTestServer(port,max,scavenge, idlePassivate);
}
@Test

View File

@ -61,8 +61,8 @@ public class MaxInactiveMigrationTest
@Before
public void setUp() throws Exception {
testServer1 = new JdbcTestServer(0, -1, 2, 1, -1);
testServer2 = new JdbcTestServer(0, -1, 2, 1, -1);
testServer1 = new JdbcTestServer(0, -1, 2, -1);
testServer2 = new JdbcTestServer(0, -1, 2, -1);
ServletContextHandler context = testServer1.addContext("");
context.addServlet(TestServlet.class, "/test");
ServletContextHandler context2 = testServer2.addContext("");

View File

@ -55,7 +55,7 @@ public class ModifyMaxInactiveIntervalTest
@Test
public void testSessionExpiryAfterModifiedMaxInactiveInterval() throws Exception
{
AbstractTestServer server = new JdbcTestServer(0,__inactive,__scavenge, __inspect, __idlePassivate);
AbstractTestServer server = new JdbcTestServer(0,__inactive,__scavenge, __idlePassivate);
ServletContextHandler ctxA = server.addContext("/mod");
ctxA.addServlet(TestModServlet.class, "/test");

View File

@ -29,9 +29,9 @@ public class NewSessionTest extends AbstractNewSessionTest
/**
* @see org.eclipse.jetty.server.session.AbstractNewSessionTest#createServer(int, int, int)
*/
public AbstractTestServer createServer(int port, int max, int scavenge, int inspect, int idlePassivate)
public AbstractTestServer createServer(int port, int max, int scavenge, int idlePassivate)
{
return new JdbcTestServer(port,max,scavenge, inspect, idlePassivate);
return new JdbcTestServer(port,max,scavenge, idlePassivate);
}
@Test

View File

@ -26,9 +26,9 @@ import org.junit.Test;
*/
public class OrphanedSessionTest extends AbstractOrphanedSessionTest
{
public AbstractTestServer createServer(int port, int max, int scavenge, int inspect, int idlePassivate)
public AbstractTestServer createServer(int port, int max, int scavenge, int idlePassivate)
{
return new JdbcTestServer(port,max,scavenge,inspect, idlePassivate);
return new JdbcTestServer(port,max,scavenge,idlePassivate);
}
@Test

View File

@ -35,9 +35,9 @@ public class ProxySerializationTest extends AbstractProxySerializationTest
* @see org.eclipse.jetty.server.session.AbstractProxySerializationTest#createServer(int, int, int)
*/
@Override
public AbstractTestServer createServer(int port, int max, int scavenge, int inspect, int idlePassivate)
public AbstractTestServer createServer(int port, int max, int scavenge, int idlePassivate)
{
return new JdbcTestServer(port, max, scavenge, inspect, idlePassivate);
return new JdbcTestServer(port, max, scavenge, idlePassivate);
}
/**

View File

@ -28,9 +28,9 @@ import org.junit.Test;
public class ReentrantRequestSessionTest extends AbstractReentrantRequestSessionTest
{
public AbstractTestServer createServer(int port, int max, int scavenge, int inspectionPeriod, int idlePassivatePeriod)
public AbstractTestServer createServer(int port, int max, int scavenge, int idlePassivatePeriod)
{
return new JdbcTestServer(port,max,scavenge,inspectionPeriod,idlePassivatePeriod);
return new JdbcTestServer(port,max,scavenge,idlePassivatePeriod);
}
@Test

View File

@ -59,7 +59,7 @@ public class SaveIntervalTest
@Test
public void testSaveInterval() throws Exception
{
AbstractTestServer server = new JdbcTestServer(0,INACTIVE,SCAVENGE, 20, -1);
AbstractTestServer server = new JdbcTestServer(0,INACTIVE,SCAVENGE, -1);
ServletContextHandler ctxA = server.addContext("/mod");
ServletHolder holder = new ServletHolder();

Some files were not shown because too many files have changed in this diff Show More