From bfeae1afa3e44bc2ce83727d712523ac83c6e850 Mon Sep 17 00:00:00 2001 From: Jan Bartel Date: Wed, 23 Mar 2016 16:59:02 +1100 Subject: [PATCH] Remove periodic iteration over sessions --- .../session/GCloudSessionDataStore.java | 2 +- .../gcloud/session/GCloudSessionManager.java | 2 +- .../InfinispanSessionDataStore.java | 2 +- .../infinispan/InfinispanSessionManager.java | 2 +- .../nosql/mongodb/MongoSessionDataStore.java | 2 +- .../nosql/mongodb/MongoSessionManager.java | 2 +- .../jetty/server/SessionIdManager.java | 12 +- .../eclipse/jetty/server/SessionManager.java | 11 ++ .../session/AbstractSessionDataStore.java | 9 +- .../session/AbstractSessionInspector.java | 103 ----------- .../server/session/AbstractSessionStore.java | 159 ++++------------ .../session/CachingSessionDataStore.java | 4 +- .../session/DefaultSessionIdManager.java | 13 +- .../jetty/server/session/ExpiryInspector.java | 119 ------------ .../server/session/FileSessionDataStore.java | 2 +- .../server/session/FileSessionManager.java | 2 +- .../server/session/HashSessionManager.java | 2 +- ...SessionInspector.java => HouseKeeper.java} | 38 ++-- .../jetty/server/session/IdleInspector.java | 114 ------------ .../server/session/JDBCSessionDataStore.java | 4 +- .../server/session/JDBCSessionManager.java | 2 +- .../server/session/MemorySessionStore.java | 18 +- .../server/session/NullSessionDataStore.java | 4 +- .../eclipse/jetty/server/session/Session.java | 172 +++++++++++++++--- .../jetty/server/session/SessionData.java | 24 ++- .../server/session/SessionDataStore.java | 3 +- .../server/session/SessionInspector.java | 36 ---- .../jetty/server/session/SessionManager.java | 150 +++++++++++++-- .../jetty/server/session/SessionStore.java | 7 +- .../server/session/SessionCookieTest.java | 47 +++-- .../jetty/server/session/FileTestServer.java | 6 +- .../jetty/server/session/IdleSessionTest.java | 4 +- .../server/session/ImmortalSessionTest.java | 4 +- .../jetty/server/session/NewSessionTest.java | 4 +- .../server/session/OrphanedSessionTest.java | 4 +- .../session/ProxySerializationTest.java | 4 +- .../session/ReentrantRequestSessionTest.java | 4 +- .../server/session/RemoveSessionTest.java | 4 +- .../server/session/SessionCookieTest.java | 4 +- .../SessionInvalidateAndCreateTest.java | 4 +- .../server/session/SessionRenewTest.java | 4 +- .../session/SessionValueSharedSaving.java | 4 +- .../gcloud/session/GCloudTestServer.java | 7 +- .../gcloud/session/ImmortalSessionTest.java | 4 +- .../session/InvalidationSessionTest.java | 4 +- .../gcloud/session/LastAccessTimeTest.java | 4 +- .../session/LocalSessionScavengingTest.java | 4 +- .../jetty/gcloud/session/NewSessionTest.java | 4 +- .../gcloud/session/OrphanedSessionTest.java | 4 +- .../session/ReentrantRequestSessionTest.java | 4 +- .../gcloud/session/RemoveSessionTest.java | 4 +- .../gcloud/session/SameNodeLoadTest.java | 6 +- .../gcloud/session/SessionExpiryTest.java | 4 +- .../SessionInvalidateAndCreateTest.java | 4 +- .../gcloud/session/SessionRenewTest.java | 4 +- .../session/SessionValueSavingTest.java | 4 +- .../jetty/server/session/HashTestServer.java | 6 +- .../server/session/ImmortalSessionTest.java | 4 +- .../jetty/server/session/NewSessionTest.java | 4 +- .../session/ReentrantRequestSessionTest.java | 6 +- .../server/session/RemoveSessionTest.java | 6 +- .../server/session/SessionCookieTest.java | 4 +- .../SessionInvalidateAndCreateTest.java | 4 +- .../server/session/SessionRenewTest.java | 4 +- .../session/SessionValueSharedSaving.java | 4 +- .../server/session/ImmortalSessionTest.java | 4 +- .../session/InfinispanTestSessionServer.java | 6 +- .../server/session/LastAccessTimeTest.java | 4 +- .../session/LocalSessionScavengingTest.java | 4 +- .../jetty/server/session/NewSessionTest.java | 4 +- .../session/ReentrantRequestSessionTest.java | 4 +- .../server/session/RemoveSessionTest.java | 4 +- .../server/session/SameNodeLoadTest.java | 4 +- .../server/session/SessionExpiryTest.java | 4 +- .../SessionInvalidateAndCreateTest.java | 4 +- .../server/session/SessionRenewTest.java | 4 +- .../remote/RemoteImmortalSessionTest.java | 4 +- .../remote/RemoteInvalidationSessionTest.java | 4 +- .../remote/RemoteLastAccessTimeTest.java | 4 +- .../RemoteLocalSessionScavengingTest.java | 4 +- .../session/remote/RemoteNewSessionTest.java | 4 +- .../RemoteReentrantRequestSessionTest.java | 4 +- .../remote/RemoteRemoveSessionTest.java | 4 +- .../remote/RemoteSameNodeLoadTest.java | 4 +- .../remote/RemoteSessionExpiryTest.java | 4 +- .../RemoteSessionInvalidateAndCreateTest.java | 4 +- .../remote/RemoteSessionRenewTest.java | 4 +- .../server/session/DirtyAttributeTest.java | 2 +- .../server/session/ImmortalSessionTest.java | 4 +- .../session/InvalidationSessionTest.java | 4 +- .../jetty/server/session/JdbcTestServer.java | 10 +- .../server/session/LastAccessTimeTest.java | 4 +- .../session/LocalSessionScavengingTest.java | 4 +- .../session/MaxInactiveMigrationTest.java | 4 +- .../ModifyMaxInactiveIntervalTest.java | 2 +- .../jetty/server/session/NewSessionTest.java | 4 +- .../server/session/OrphanedSessionTest.java | 4 +- .../session/ProxySerializationTest.java | 4 +- .../session/ReentrantRequestSessionTest.java | 4 +- .../server/session/SaveIntervalTest.java | 2 +- .../server/session/SessionExpiryTest.java | 4 +- .../SessionInvalidateAndCreateTest.java | 4 +- .../server/session/SessionRenewTest.java | 4 +- .../session/SessionValueSavingTest.java | 4 +- .../nosql/mongodb/AttributeNameTest.java | 8 +- .../jetty/nosql/mongodb/IdleSessionTest.java | 4 +- .../nosql/mongodb/InvalidateSessionTest.java | 4 +- .../nosql/mongodb/LastAccessTimeTest.java | 4 +- .../mongodb/LocalSessionScavengingTest.java | 4 +- .../jetty/nosql/mongodb/MongoTestServer.java | 14 +- .../jetty/nosql/mongodb/NewSessionTest.java | 4 +- .../nosql/mongodb/OrphanedSessionTest.java | 4 +- .../mongodb/ReentrantRequestSessionTest.java | 6 +- .../nosql/mongodb/RemoveSessionTest.java | 4 +- .../nosql/mongodb/SessionExpiryTest.java | 20 +- .../SessionInvalidateAndCreateTest.java | 4 +- .../jetty/nosql/mongodb/SessionRenewTest.java | 4 +- .../nosql/mongodb/SessionSavingValueTest.java | 4 +- .../session/AbstractIdleSessionTest.java | 16 +- .../session/AbstractImmortalSessionTest.java | 5 +- .../AbstractInvalidationSessionTest.java | 6 +- .../session/AbstractLastAccessTimeTest.java | 7 +- .../AbstractLocalSessionScavengingTest.java | 6 +- .../session/AbstractNewSessionTest.java | 4 +- .../session/AbstractOrphanedSessionTest.java | 6 +- .../AbstractProxySerializationTest.java | 4 +- .../AbstractReentrantRequestSessionTest.java | 4 +- .../session/AbstractRemoveSessionTest.java | 4 +- .../session/AbstractSameNodeLoadTest.java | 4 +- .../session/AbstractSessionCookieTest.java | 4 +- .../session/AbstractSessionExpiryTest.java | 6 +- ...bstractSessionInvalidateAndCreateTest.java | 7 +- .../session/AbstractSessionRenewTest.java | 4 +- .../AbstractSessionValueSavingTest.java | 4 +- .../server/session/AbstractTestServer.java | 26 ++- 135 files changed, 682 insertions(+), 901 deletions(-) delete mode 100644 jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionInspector.java delete mode 100644 jetty-server/src/main/java/org/eclipse/jetty/server/session/ExpiryInspector.java rename jetty-server/src/main/java/org/eclipse/jetty/server/session/{PeriodicSessionInspector.java => HouseKeeper.java} (85%) delete mode 100644 jetty-server/src/main/java/org/eclipse/jetty/server/session/IdleInspector.java delete mode 100644 jetty-server/src/main/java/org/eclipse/jetty/server/session/SessionInspector.java diff --git a/jetty-gcloud/jetty-gcloud-session-manager/src/main/java/org/eclipse/jetty/gcloud/session/GCloudSessionDataStore.java b/jetty-gcloud/jetty-gcloud-session-manager/src/main/java/org/eclipse/jetty/gcloud/session/GCloudSessionDataStore.java index 00cc016e4f5..6c147fe6e49 100644 --- a/jetty-gcloud/jetty-gcloud-session-manager/src/main/java/org/eclipse/jetty/gcloud/session/GCloudSessionDataStore.java +++ b/jetty-gcloud/jetty-gcloud-session-manager/src/main/java/org/eclipse/jetty/gcloud/session/GCloudSessionDataStore.java @@ -185,7 +185,7 @@ public class GCloudSessionDataStore extends AbstractSessionDataStore * @see org.eclipse.jetty.server.session.SessionDataStore#getExpired(Set, int) */ @Override - public Set doGetExpired(Set candidates, int expiryTimeoutSec) + public Set doGetExpired(Set candidates) { long now = System.currentTimeMillis(); Set expired = new HashSet(); diff --git a/jetty-gcloud/jetty-gcloud-session-manager/src/main/java/org/eclipse/jetty/gcloud/session/GCloudSessionManager.java b/jetty-gcloud/jetty-gcloud-session-manager/src/main/java/org/eclipse/jetty/gcloud/session/GCloudSessionManager.java index d029ab9bbfb..1677383b51e 100644 --- a/jetty-gcloud/jetty-gcloud-session-manager/src/main/java/org/eclipse/jetty/gcloud/session/GCloudSessionManager.java +++ b/jetty-gcloud/jetty-gcloud-session-manager/src/main/java/org/eclipse/jetty/gcloud/session/GCloudSessionManager.java @@ -46,7 +46,7 @@ public class GCloudSessionManager extends SessionManager public GCloudSessionManager() { _sessionDataStore = new GCloudSessionDataStore(); - _sessionStore = new MemorySessionStore(); + setSessionStore(new MemorySessionStore(this)); } diff --git a/jetty-infinispan/src/main/java/org/eclipse/jetty/session/infinispan/InfinispanSessionDataStore.java b/jetty-infinispan/src/main/java/org/eclipse/jetty/session/infinispan/InfinispanSessionDataStore.java index e8db3b1a32c..6b661a03e8a 100644 --- a/jetty-infinispan/src/main/java/org/eclipse/jetty/session/infinispan/InfinispanSessionDataStore.java +++ b/jetty-infinispan/src/main/java/org/eclipse/jetty/session/infinispan/InfinispanSessionDataStore.java @@ -134,7 +134,7 @@ public class InfinispanSessionDataStore extends AbstractSessionDataStore * @see org.eclipse.jetty.server.session.SessionDataStore#getExpired(Set, int) */ @Override - public Set doGetExpired(Set candidates, int expiryTimeoutSec) + public Set doGetExpired(Set candidates) { if (candidates == null || candidates.isEmpty()) return candidates; diff --git a/jetty-infinispan/src/main/java/org/eclipse/jetty/session/infinispan/InfinispanSessionManager.java b/jetty-infinispan/src/main/java/org/eclipse/jetty/session/infinispan/InfinispanSessionManager.java index 25bec8dfab8..deec178e873 100644 --- a/jetty-infinispan/src/main/java/org/eclipse/jetty/session/infinispan/InfinispanSessionManager.java +++ b/jetty-infinispan/src/main/java/org/eclipse/jetty/session/infinispan/InfinispanSessionManager.java @@ -42,7 +42,7 @@ public class InfinispanSessionManager extends SessionManager public InfinispanSessionManager() { - _sessionStore = new MemorySessionStore(); + setSessionStore(new MemorySessionStore(this)); _sessionDataStore = new InfinispanSessionDataStore(); } diff --git a/jetty-nosql/src/main/java/org/eclipse/jetty/nosql/mongodb/MongoSessionDataStore.java b/jetty-nosql/src/main/java/org/eclipse/jetty/nosql/mongodb/MongoSessionDataStore.java index 47b20f281a7..048f1747db8 100644 --- a/jetty-nosql/src/main/java/org/eclipse/jetty/nosql/mongodb/MongoSessionDataStore.java +++ b/jetty-nosql/src/main/java/org/eclipse/jetty/nosql/mongodb/MongoSessionDataStore.java @@ -348,7 +348,7 @@ public class MongoSessionDataStore extends NoSqlSessionDataStore * @see org.eclipse.jetty.server.session.SessionDataStore#getExpired(Set, int) */ @Override - public Set doGetExpired(Set candidates, int expiryTimeoutSec) + public Set doGetExpired(Set candidates) { long now = System.currentTimeMillis(); long upperBound = now; diff --git a/jetty-nosql/src/main/java/org/eclipse/jetty/nosql/mongodb/MongoSessionManager.java b/jetty-nosql/src/main/java/org/eclipse/jetty/nosql/mongodb/MongoSessionManager.java index 74c83c1e11b..ed42e8d34e2 100644 --- a/jetty-nosql/src/main/java/org/eclipse/jetty/nosql/mongodb/MongoSessionManager.java +++ b/jetty-nosql/src/main/java/org/eclipse/jetty/nosql/mongodb/MongoSessionManager.java @@ -99,7 +99,7 @@ public class MongoSessionManager extends SessionManager /* ------------------------------------------------------------ */ public MongoSessionManager() throws UnknownHostException, MongoException { - _sessionStore = new MemorySessionStore(); + setSessionStore(new MemorySessionStore(this)); _sessionDataStore = new MongoSessionDataStore(); } diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/SessionIdManager.java b/jetty-server/src/main/java/org/eclipse/jetty/server/SessionIdManager.java index 849000940ea..97f0b45fe34 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/SessionIdManager.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/SessionIdManager.java @@ -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 getSessionManagers(); } diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/SessionManager.java b/jetty-server/src/main/java/org/eclipse/jetty/server/SessionManager.java index d227ab2c76a..85a8734669a 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/SessionManager.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/SessionManager.java @@ -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 getDefaultSessionTrackingModes(); @@ -321,5 +327,10 @@ public interface SessionManager extends LifeCycle */ public boolean isIdInUse (String id) throws Exception; + /** + * + */ + public void scavenge (); + } diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionDataStore.java b/jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionDataStore.java index a0f02c36325..9dc9828c7ed 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionDataStore.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionDataStore.java @@ -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 doGetExpired (Set candidates, int scavengePeriodSec); + public abstract Set doGetExpired (Set 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 getExpired(Set candidates, int scavengePeriodSec) + public Set getExpired(Set candidates) { try { - return doGetExpired (candidates, scavengePeriodSec); + return doGetExpired (candidates); } finally { diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionInspector.java b/jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionInspector.java deleted file mode 100644 index b9163da897f..00000000000 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionInspector.java +++ /dev/null @@ -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 -{ - /** - *
    - *
  • <0 means never inspect
  • - *
  • 0 means always inspect
  • - *
  • >0 means inspect at that interval
  • - *
- */ - 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 - } -} diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionStore.java b/jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionStore.java index 415be8df4e4..3c86e272da9 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionStore.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionStore.java @@ -42,24 +42,29 @@ public abstract class AbstractSessionStore extends AbstractLifeCycle implements { final static Logger LOG = Log.getLogger("org.eclipse.jetty.server.session"); - protected ArrayList _inspectors = new ArrayList(); 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 stream = getStream(); - - synchronized (_inspectors) - { - try - { - final ArrayList wantInspect = new ArrayList(); - 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; } } diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/session/CachingSessionDataStore.java b/jetty-server/src/main/java/org/eclipse/jetty/server/session/CachingSessionDataStore.java index 7a252911f9f..0dd94019174 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/session/CachingSessionDataStore.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/session/CachingSessionDataStore.java @@ -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 doGetExpired(Set candidates, int expiryTimeoutSec) + public Set doGetExpired(Set candidates) { // TODO Auto-generated method stub return null; diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/session/DefaultSessionIdManager.java b/jetty-server/src/main/java/org/eclipse/jetty/server/session/DefaultSessionIdManager.java index 7a2235b9a1c..f59c1c5e779 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/session/DefaultSessionIdManager.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/session/DefaultSessionIdManager.java @@ -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 getSessionManagers() + public Set getSessionManagers() { - Set managers = new HashSet<>(); + Set managers = new HashSet<>(); Handler[] contexts = _server.getChildHandlersByClass(ContextHandler.class); for (int i=0; contexts!=null && i _expiryCandidates = new HashSet(); - 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 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 candidates = _sessionStore.checkExpiration(_expiryCandidates); - for (String id:candidates) - { - _idManager.expireAll(id); - } - } - catch (Exception e) - { - LOG.warn(e); - } - finally - { - _expiryCandidates.clear(); - } - } -} diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/session/FileSessionDataStore.java b/jetty-server/src/main/java/org/eclipse/jetty/server/session/FileSessionDataStore.java index a00206d54fc..f5e621e6c7b 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/session/FileSessionDataStore.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/session/FileSessionDataStore.java @@ -115,7 +115,7 @@ public class FileSessionDataStore extends AbstractSessionDataStore * @see org.eclipse.jetty.server.session.SessionDataStore#getExpired(Set, int) */ @Override - public Set doGetExpired(final Set candidates, final int expiryTimeoutSec) + public Set doGetExpired(final Set candidates) { final long now = System.currentTimeMillis(); HashSet expired = new HashSet(); diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/session/FileSessionManager.java b/jetty-server/src/main/java/org/eclipse/jetty/server/session/FileSessionManager.java index 1f79b33baa4..6ea91b7b881 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/session/FileSessionManager.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/session/FileSessionManager.java @@ -34,7 +34,7 @@ public class FileSessionManager extends SessionManager */ public FileSessionManager () { - _sessionStore = new MemorySessionStore(); + setSessionStore(new MemorySessionStore(this)); _sessionDataStore = new FileSessionDataStore(); } diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/session/HashSessionManager.java b/jetty-server/src/main/java/org/eclipse/jetty/server/session/HashSessionManager.java index c81a2598351..c2faf3db493 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/session/HashSessionManager.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/session/HashSessionManager.java @@ -35,7 +35,7 @@ public class HashSessionManager extends SessionManager */ public HashSessionManager () { - _sessionStore = new MemorySessionStore(); + setSessionStore(new MemorySessionStore(this)); } @Override diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/session/PeriodicSessionInspector.java b/jetty-server/src/main/java/org/eclipse/jetty/server/session/HouseKeeper.java similarity index 85% rename from jetty-server/src/main/java/org/eclipse/jetty/server/session/PeriodicSessionInspector.java rename to jetty-server/src/main/java/org/eclipse/jetty/server/session/HouseKeeper.java index bf1254c189f..cae29013130 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/session/PeriodicSessionInspector.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/session/HouseKeeper.java @@ -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); + } } } } diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/session/IdleInspector.java b/jetty-server/src/main/java/org/eclipse/jetty/server/session/IdleInspector.java deleted file mode 100644 index bac6787f716..00000000000 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/session/IdleInspector.java +++ /dev/null @@ -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 _idleCandidates = new HashSet();; - 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 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(); - } -} diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/session/JDBCSessionDataStore.java b/jetty-server/src/main/java/org/eclipse/jetty/server/session/JDBCSessionDataStore.java index 8f5329b427c..e55e89f04de 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/session/JDBCSessionDataStore.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/session/JDBCSessionDataStore.java @@ -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 doGetExpired(Set candidates, int scavengeIntervalSec) + public Set doGetExpired(Set candidates) { if (LOG.isDebugEnabled()) LOG.debug("Getting expired sessions "+System.currentTimeMillis()); diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/session/JDBCSessionManager.java b/jetty-server/src/main/java/org/eclipse/jetty/server/session/JDBCSessionManager.java index 8395d99a47e..fc345fdba6b 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/session/JDBCSessionManager.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/session/JDBCSessionManager.java @@ -31,7 +31,7 @@ public class JDBCSessionManager extends SessionManager public JDBCSessionManager() { - _sessionStore = new MemorySessionStore(); + setSessionStore(new MemorySessionStore(this)); _sessionDataStore = new JDBCSessionDataStore(); } diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/session/MemorySessionStore.java b/jetty-server/src/main/java/org/eclipse/jetty/server/session/MemorySessionStore.java index de307fb53ed..6e2404df1d3 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/session/MemorySessionStore.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/session/MemorySessionStore.java @@ -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 getStream() - { - return _sessions.values().stream(); - } /** diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/session/NullSessionDataStore.java b/jetty-server/src/main/java/org/eclipse/jetty/server/session/NullSessionDataStore.java index b03516a8d45..2c56d898257 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/session/NullSessionDataStore.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/session/NullSessionDataStore.java @@ -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 doGetExpired(Set candidates, int expiryTimeoutSec) + public Set doGetExpired(Set candidates) { return candidates; //whatever is suggested we accept } diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/session/Session.java b/jetty-server/src/main/java/org/eclipse/jetty/server/session/Session.java index bf0593116e2..5c377a67ed9 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/session/Session.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/session/Session.java @@ -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"); + } } } diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/session/SessionData.java b/jetty-server/src/main/java/org/eclipse/jetty/server/session/SessionData.java index 0dc66ab09de..e46782f96b2 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/session/SessionData.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/session/SessionData.java @@ -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 _attributes = new ConcurrentHashMap(); 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() { diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/session/SessionDataStore.java b/jetty-server/src/main/java/org/eclipse/jetty/server/session/SessionDataStore.java index 57944f9bcdd..5c430ad21f4 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/session/SessionDataStore.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/session/SessionDataStore.java @@ -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 getExpired (Set candidates, int scavengePeriodSec); + public Set getExpired (Set candidates); diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/session/SessionInspector.java b/jetty-server/src/main/java/org/eclipse/jetty/server/session/SessionInspector.java deleted file mode 100644 index cae4568d1ea..00000000000 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/session/SessionInspector.java +++ /dev/null @@ -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 -} diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/session/SessionManager.java b/jetty-server/src/main/java/org/eclipse/jetty/server/session/SessionManager.java index 7aa280ab5a1..d2267207c41 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/session/SessionManager.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/session/SessionManager.java @@ -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 _candidateSessionIdsForExpiry = new ConcurrentHashSet(); + + 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 candidates = new HashSet(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 } } } + } diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/session/SessionStore.java b/jetty-server/src/main/java/org/eclipse/jetty/server/session/SessionStore.java index 9c281b416dd..41db0d8e0d8 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/session/SessionStore.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/session/SessionStore.java @@ -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 checkExpiration (Set candidates); - void inspect(); void setIdlePassivationTimeoutSec(int sec); int getIdlePassivationTimeoutSec(); - int getExpiryTimeoutSec(); - void setExpiryTimeoutSec(int sec); - Stream getStream(); SessionDataStore getSessionDataStore(); + void passivateIdleSession(String id); } diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/session/SessionCookieTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/session/SessionCookieTest.java index 1f56697704f..687856fb59a 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/session/SessionCookieTest.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/session/SessionCookieTest.java @@ -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 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(); diff --git a/tests/test-sessions/test-file-sessions/src/test/java/org/eclipse/jetty/server/session/FileTestServer.java b/tests/test-sessions/test-file-sessions/src/test/java/org/eclipse/jetty/server/session/FileTestServer.java index 2b7abb69d63..67eea3e3675 100644 --- a/tests/test-sessions/test-file-sessions/src/test/java/org/eclipse/jetty/server/session/FileTestServer.java +++ b/tests/test-sessions/test-file-sessions/src/test/java/org/eclipse/jetty/server/session/FileTestServer.java @@ -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); } diff --git a/tests/test-sessions/test-file-sessions/src/test/java/org/eclipse/jetty/server/session/IdleSessionTest.java b/tests/test-sessions/test-file-sessions/src/test/java/org/eclipse/jetty/server/session/IdleSessionTest.java index dac1d64f382..1dc27c2b8c9 100644 --- a/tests/test-sessions/test-file-sessions/src/test/java/org/eclipse/jetty/server/session/IdleSessionTest.java +++ b/tests/test-sessions/test-file-sessions/src/test/java/org/eclipse/jetty/server/session/IdleSessionTest.java @@ -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); } diff --git a/tests/test-sessions/test-file-sessions/src/test/java/org/eclipse/jetty/server/session/ImmortalSessionTest.java b/tests/test-sessions/test-file-sessions/src/test/java/org/eclipse/jetty/server/session/ImmortalSessionTest.java index c58645ac7e2..4cffa43c715 100644 --- a/tests/test-sessions/test-file-sessions/src/test/java/org/eclipse/jetty/server/session/ImmortalSessionTest.java +++ b/tests/test-sessions/test-file-sessions/src/test/java/org/eclipse/jetty/server/session/ImmortalSessionTest.java @@ -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); } } diff --git a/tests/test-sessions/test-file-sessions/src/test/java/org/eclipse/jetty/server/session/NewSessionTest.java b/tests/test-sessions/test-file-sessions/src/test/java/org/eclipse/jetty/server/session/NewSessionTest.java index 209b52a7257..d015d47fea2 100644 --- a/tests/test-sessions/test-file-sessions/src/test/java/org/eclipse/jetty/server/session/NewSessionTest.java +++ b/tests/test-sessions/test-file-sessions/src/test/java/org/eclipse/jetty/server/session/NewSessionTest.java @@ -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 diff --git a/tests/test-sessions/test-file-sessions/src/test/java/org/eclipse/jetty/server/session/OrphanedSessionTest.java b/tests/test-sessions/test-file-sessions/src/test/java/org/eclipse/jetty/server/session/OrphanedSessionTest.java index af08089c0ba..4eabeaf67c5 100644 --- a/tests/test-sessions/test-file-sessions/src/test/java/org/eclipse/jetty/server/session/OrphanedSessionTest.java +++ b/tests/test-sessions/test-file-sessions/src/test/java/org/eclipse/jetty/server/session/OrphanedSessionTest.java @@ -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 diff --git a/tests/test-sessions/test-file-sessions/src/test/java/org/eclipse/jetty/server/session/ProxySerializationTest.java b/tests/test-sessions/test-file-sessions/src/test/java/org/eclipse/jetty/server/session/ProxySerializationTest.java index c6deac078f3..a65dd5b6754 100644 --- a/tests/test-sessions/test-file-sessions/src/test/java/org/eclipse/jetty/server/session/ProxySerializationTest.java +++ b/tests/test-sessions/test-file-sessions/src/test/java/org/eclipse/jetty/server/session/ProxySerializationTest.java @@ -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); } diff --git a/tests/test-sessions/test-file-sessions/src/test/java/org/eclipse/jetty/server/session/ReentrantRequestSessionTest.java b/tests/test-sessions/test-file-sessions/src/test/java/org/eclipse/jetty/server/session/ReentrantRequestSessionTest.java index 9205ae43d57..0391f14f3a8 100644 --- a/tests/test-sessions/test-file-sessions/src/test/java/org/eclipse/jetty/server/session/ReentrantRequestSessionTest.java +++ b/tests/test-sessions/test-file-sessions/src/test/java/org/eclipse/jetty/server/session/ReentrantRequestSessionTest.java @@ -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 diff --git a/tests/test-sessions/test-file-sessions/src/test/java/org/eclipse/jetty/server/session/RemoveSessionTest.java b/tests/test-sessions/test-file-sessions/src/test/java/org/eclipse/jetty/server/session/RemoveSessionTest.java index 0cd43d13594..2eb2d436ec0 100644 --- a/tests/test-sessions/test-file-sessions/src/test/java/org/eclipse/jetty/server/session/RemoveSessionTest.java +++ b/tests/test-sessions/test-file-sessions/src/test/java/org/eclipse/jetty/server/session/RemoveSessionTest.java @@ -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 diff --git a/tests/test-sessions/test-file-sessions/src/test/java/org/eclipse/jetty/server/session/SessionCookieTest.java b/tests/test-sessions/test-file-sessions/src/test/java/org/eclipse/jetty/server/session/SessionCookieTest.java index 191b5538ad4..a57da95e836 100644 --- a/tests/test-sessions/test-file-sessions/src/test/java/org/eclipse/jetty/server/session/SessionCookieTest.java +++ b/tests/test-sessions/test-file-sessions/src/test/java/org/eclipse/jetty/server/session/SessionCookieTest.java @@ -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); } } diff --git a/tests/test-sessions/test-file-sessions/src/test/java/org/eclipse/jetty/server/session/SessionInvalidateAndCreateTest.java b/tests/test-sessions/test-file-sessions/src/test/java/org/eclipse/jetty/server/session/SessionInvalidateAndCreateTest.java index 059b843f13b..c29eb51ff6e 100644 --- a/tests/test-sessions/test-file-sessions/src/test/java/org/eclipse/jetty/server/session/SessionInvalidateAndCreateTest.java +++ b/tests/test-sessions/test-file-sessions/src/test/java/org/eclipse/jetty/server/session/SessionInvalidateAndCreateTest.java @@ -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 diff --git a/tests/test-sessions/test-file-sessions/src/test/java/org/eclipse/jetty/server/session/SessionRenewTest.java b/tests/test-sessions/test-file-sessions/src/test/java/org/eclipse/jetty/server/session/SessionRenewTest.java index 470db440198..7ef1fc1824a 100644 --- a/tests/test-sessions/test-file-sessions/src/test/java/org/eclipse/jetty/server/session/SessionRenewTest.java +++ b/tests/test-sessions/test-file-sessions/src/test/java/org/eclipse/jetty/server/session/SessionRenewTest.java @@ -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 diff --git a/tests/test-sessions/test-file-sessions/src/test/java/org/eclipse/jetty/server/session/SessionValueSharedSaving.java b/tests/test-sessions/test-file-sessions/src/test/java/org/eclipse/jetty/server/session/SessionValueSharedSaving.java index e54a2c7f16e..65a2a26ad66 100644 --- a/tests/test-sessions/test-file-sessions/src/test/java/org/eclipse/jetty/server/session/SessionValueSharedSaving.java +++ b/tests/test-sessions/test-file-sessions/src/test/java/org/eclipse/jetty/server/session/SessionValueSharedSaving.java @@ -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); } } diff --git a/tests/test-sessions/test-gcloud-sessions/src/test/java/org/eclipse/jetty/gcloud/session/GCloudTestServer.java b/tests/test-sessions/test-gcloud-sessions/src/test/java/org/eclipse/jetty/gcloud/session/GCloudTestServer.java index d983bd7d87b..806f80b7e60 100644 --- a/tests/test-sessions/test-gcloud-sessions/src/test/java/org/eclipse/jetty/gcloud/session/GCloudTestServer.java +++ b/tests/test-sessions/test-gcloud-sessions/src/test/java/org/eclipse/jetty/gcloud/session/GCloudTestServer.java @@ -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); } diff --git a/tests/test-sessions/test-gcloud-sessions/src/test/java/org/eclipse/jetty/gcloud/session/ImmortalSessionTest.java b/tests/test-sessions/test-gcloud-sessions/src/test/java/org/eclipse/jetty/gcloud/session/ImmortalSessionTest.java index 2f1c18eeaa3..c0b40ea65e0 100644 --- a/tests/test-sessions/test-gcloud-sessions/src/test/java/org/eclipse/jetty/gcloud/session/ImmortalSessionTest.java +++ b/tests/test-sessions/test-gcloud-sessions/src/test/java/org/eclipse/jetty/gcloud/session/ImmortalSessionTest.java @@ -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 diff --git a/tests/test-sessions/test-gcloud-sessions/src/test/java/org/eclipse/jetty/gcloud/session/InvalidationSessionTest.java b/tests/test-sessions/test-gcloud-sessions/src/test/java/org/eclipse/jetty/gcloud/session/InvalidationSessionTest.java index 6079c2c8419..0813ae90b5f 100644 --- a/tests/test-sessions/test-gcloud-sessions/src/test/java/org/eclipse/jetty/gcloud/session/InvalidationSessionTest.java +++ b/tests/test-sessions/test-gcloud-sessions/src/test/java/org/eclipse/jetty/gcloud/session/InvalidationSessionTest.java @@ -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() diff --git a/tests/test-sessions/test-gcloud-sessions/src/test/java/org/eclipse/jetty/gcloud/session/LastAccessTimeTest.java b/tests/test-sessions/test-gcloud-sessions/src/test/java/org/eclipse/jetty/gcloud/session/LastAccessTimeTest.java index 27dfbc9f7bb..289490462c4 100644 --- a/tests/test-sessions/test-gcloud-sessions/src/test/java/org/eclipse/jetty/gcloud/session/LastAccessTimeTest.java +++ b/tests/test-sessions/test-gcloud-sessions/src/test/java/org/eclipse/jetty/gcloud/session/LastAccessTimeTest.java @@ -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 diff --git a/tests/test-sessions/test-gcloud-sessions/src/test/java/org/eclipse/jetty/gcloud/session/LocalSessionScavengingTest.java b/tests/test-sessions/test-gcloud-sessions/src/test/java/org/eclipse/jetty/gcloud/session/LocalSessionScavengingTest.java index 9c2837888e4..f2b955b217f 100644 --- a/tests/test-sessions/test-gcloud-sessions/src/test/java/org/eclipse/jetty/gcloud/session/LocalSessionScavengingTest.java +++ b/tests/test-sessions/test-gcloud-sessions/src/test/java/org/eclipse/jetty/gcloud/session/LocalSessionScavengingTest.java @@ -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 diff --git a/tests/test-sessions/test-gcloud-sessions/src/test/java/org/eclipse/jetty/gcloud/session/NewSessionTest.java b/tests/test-sessions/test-gcloud-sessions/src/test/java/org/eclipse/jetty/gcloud/session/NewSessionTest.java index 0038b6ec041..6ef410a05db 100644 --- a/tests/test-sessions/test-gcloud-sessions/src/test/java/org/eclipse/jetty/gcloud/session/NewSessionTest.java +++ b/tests/test-sessions/test-gcloud-sessions/src/test/java/org/eclipse/jetty/gcloud/session/NewSessionTest.java @@ -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 diff --git a/tests/test-sessions/test-gcloud-sessions/src/test/java/org/eclipse/jetty/gcloud/session/OrphanedSessionTest.java b/tests/test-sessions/test-gcloud-sessions/src/test/java/org/eclipse/jetty/gcloud/session/OrphanedSessionTest.java index 400ff352100..f8e815a2056 100644 --- a/tests/test-sessions/test-gcloud-sessions/src/test/java/org/eclipse/jetty/gcloud/session/OrphanedSessionTest.java +++ b/tests/test-sessions/test-gcloud-sessions/src/test/java/org/eclipse/jetty/gcloud/session/OrphanedSessionTest.java @@ -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 diff --git a/tests/test-sessions/test-gcloud-sessions/src/test/java/org/eclipse/jetty/gcloud/session/ReentrantRequestSessionTest.java b/tests/test-sessions/test-gcloud-sessions/src/test/java/org/eclipse/jetty/gcloud/session/ReentrantRequestSessionTest.java index d8ff9212304..45fbd6f2c55 100644 --- a/tests/test-sessions/test-gcloud-sessions/src/test/java/org/eclipse/jetty/gcloud/session/ReentrantRequestSessionTest.java +++ b/tests/test-sessions/test-gcloud-sessions/src/test/java/org/eclipse/jetty/gcloud/session/ReentrantRequestSessionTest.java @@ -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 diff --git a/tests/test-sessions/test-gcloud-sessions/src/test/java/org/eclipse/jetty/gcloud/session/RemoveSessionTest.java b/tests/test-sessions/test-gcloud-sessions/src/test/java/org/eclipse/jetty/gcloud/session/RemoveSessionTest.java index bbd25a7cd38..00060b793d9 100644 --- a/tests/test-sessions/test-gcloud-sessions/src/test/java/org/eclipse/jetty/gcloud/session/RemoveSessionTest.java +++ b/tests/test-sessions/test-gcloud-sessions/src/test/java/org/eclipse/jetty/gcloud/session/RemoveSessionTest.java @@ -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 diff --git a/tests/test-sessions/test-gcloud-sessions/src/test/java/org/eclipse/jetty/gcloud/session/SameNodeLoadTest.java b/tests/test-sessions/test-gcloud-sessions/src/test/java/org/eclipse/jetty/gcloud/session/SameNodeLoadTest.java index 3a94769c9d6..d945fb39599 100644 --- a/tests/test-sessions/test-gcloud-sessions/src/test/java/org/eclipse/jetty/gcloud/session/SameNodeLoadTest.java +++ b/tests/test-sessions/test-gcloud-sessions/src/test/java/org/eclipse/jetty/gcloud/session/SameNodeLoadTest.java @@ -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 diff --git a/tests/test-sessions/test-gcloud-sessions/src/test/java/org/eclipse/jetty/gcloud/session/SessionExpiryTest.java b/tests/test-sessions/test-gcloud-sessions/src/test/java/org/eclipse/jetty/gcloud/session/SessionExpiryTest.java index 9d7499987b6..8162dcf97b6 100644 --- a/tests/test-sessions/test-gcloud-sessions/src/test/java/org/eclipse/jetty/gcloud/session/SessionExpiryTest.java +++ b/tests/test-sessions/test-gcloud-sessions/src/test/java/org/eclipse/jetty/gcloud/session/SessionExpiryTest.java @@ -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 diff --git a/tests/test-sessions/test-gcloud-sessions/src/test/java/org/eclipse/jetty/gcloud/session/SessionInvalidateAndCreateTest.java b/tests/test-sessions/test-gcloud-sessions/src/test/java/org/eclipse/jetty/gcloud/session/SessionInvalidateAndCreateTest.java index ea506a6ed0f..84ce3fd575a 100644 --- a/tests/test-sessions/test-gcloud-sessions/src/test/java/org/eclipse/jetty/gcloud/session/SessionInvalidateAndCreateTest.java +++ b/tests/test-sessions/test-gcloud-sessions/src/test/java/org/eclipse/jetty/gcloud/session/SessionInvalidateAndCreateTest.java @@ -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 diff --git a/tests/test-sessions/test-gcloud-sessions/src/test/java/org/eclipse/jetty/gcloud/session/SessionRenewTest.java b/tests/test-sessions/test-gcloud-sessions/src/test/java/org/eclipse/jetty/gcloud/session/SessionRenewTest.java index f152038e000..17a19678500 100644 --- a/tests/test-sessions/test-gcloud-sessions/src/test/java/org/eclipse/jetty/gcloud/session/SessionRenewTest.java +++ b/tests/test-sessions/test-gcloud-sessions/src/test/java/org/eclipse/jetty/gcloud/session/SessionRenewTest.java @@ -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 diff --git a/tests/test-sessions/test-gcloud-sessions/src/test/java/org/eclipse/jetty/gcloud/session/SessionValueSavingTest.java b/tests/test-sessions/test-gcloud-sessions/src/test/java/org/eclipse/jetty/gcloud/session/SessionValueSavingTest.java index ec824880805..83a3f49325c 100644 --- a/tests/test-sessions/test-gcloud-sessions/src/test/java/org/eclipse/jetty/gcloud/session/SessionValueSavingTest.java +++ b/tests/test-sessions/test-gcloud-sessions/src/test/java/org/eclipse/jetty/gcloud/session/SessionValueSavingTest.java @@ -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 diff --git a/tests/test-sessions/test-hash-sessions/src/test/java/org/eclipse/jetty/server/session/HashTestServer.java b/tests/test-sessions/test-hash-sessions/src/test/java/org/eclipse/jetty/server/session/HashTestServer.java index 1a761633a14..c5ea6e5305d 100644 --- a/tests/test-sessions/test-hash-sessions/src/test/java/org/eclipse/jetty/server/session/HashTestServer.java +++ b/tests/test-sessions/test-hash-sessions/src/test/java/org/eclipse/jetty/server/session/HashTestServer.java @@ -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); } diff --git a/tests/test-sessions/test-hash-sessions/src/test/java/org/eclipse/jetty/server/session/ImmortalSessionTest.java b/tests/test-sessions/test-hash-sessions/src/test/java/org/eclipse/jetty/server/session/ImmortalSessionTest.java index cca3bb13ac5..0bd03ccc9c9 100644 --- a/tests/test-sessions/test-hash-sessions/src/test/java/org/eclipse/jetty/server/session/ImmortalSessionTest.java +++ b/tests/test-sessions/test-hash-sessions/src/test/java/org/eclipse/jetty/server/session/ImmortalSessionTest.java @@ -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); } } diff --git a/tests/test-sessions/test-hash-sessions/src/test/java/org/eclipse/jetty/server/session/NewSessionTest.java b/tests/test-sessions/test-hash-sessions/src/test/java/org/eclipse/jetty/server/session/NewSessionTest.java index d64fe794d97..419381b3668 100644 --- a/tests/test-sessions/test-hash-sessions/src/test/java/org/eclipse/jetty/server/session/NewSessionTest.java +++ b/tests/test-sessions/test-hash-sessions/src/test/java/org/eclipse/jetty/server/session/NewSessionTest.java @@ -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 diff --git a/tests/test-sessions/test-hash-sessions/src/test/java/org/eclipse/jetty/server/session/ReentrantRequestSessionTest.java b/tests/test-sessions/test-hash-sessions/src/test/java/org/eclipse/jetty/server/session/ReentrantRequestSessionTest.java index 056627087ac..4ff255706c7 100644 --- a/tests/test-sessions/test-hash-sessions/src/test/java/org/eclipse/jetty/server/session/ReentrantRequestSessionTest.java +++ b/tests/test-sessions/test-hash-sessions/src/test/java/org/eclipse/jetty/server/session/ReentrantRequestSessionTest.java @@ -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 diff --git a/tests/test-sessions/test-hash-sessions/src/test/java/org/eclipse/jetty/server/session/RemoveSessionTest.java b/tests/test-sessions/test-hash-sessions/src/test/java/org/eclipse/jetty/server/session/RemoveSessionTest.java index 454923d1f95..aae01a17a47 100644 --- a/tests/test-sessions/test-hash-sessions/src/test/java/org/eclipse/jetty/server/session/RemoveSessionTest.java +++ b/tests/test-sessions/test-hash-sessions/src/test/java/org/eclipse/jetty/server/session/RemoveSessionTest.java @@ -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); } } diff --git a/tests/test-sessions/test-hash-sessions/src/test/java/org/eclipse/jetty/server/session/SessionCookieTest.java b/tests/test-sessions/test-hash-sessions/src/test/java/org/eclipse/jetty/server/session/SessionCookieTest.java index 9c13116fe18..3edaf930fc2 100644 --- a/tests/test-sessions/test-hash-sessions/src/test/java/org/eclipse/jetty/server/session/SessionCookieTest.java +++ b/tests/test-sessions/test-hash-sessions/src/test/java/org/eclipse/jetty/server/session/SessionCookieTest.java @@ -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); } } diff --git a/tests/test-sessions/test-hash-sessions/src/test/java/org/eclipse/jetty/server/session/SessionInvalidateAndCreateTest.java b/tests/test-sessions/test-hash-sessions/src/test/java/org/eclipse/jetty/server/session/SessionInvalidateAndCreateTest.java index f34ea958624..920b5a2b2d0 100644 --- a/tests/test-sessions/test-hash-sessions/src/test/java/org/eclipse/jetty/server/session/SessionInvalidateAndCreateTest.java +++ b/tests/test-sessions/test-hash-sessions/src/test/java/org/eclipse/jetty/server/session/SessionInvalidateAndCreateTest.java @@ -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 diff --git a/tests/test-sessions/test-hash-sessions/src/test/java/org/eclipse/jetty/server/session/SessionRenewTest.java b/tests/test-sessions/test-hash-sessions/src/test/java/org/eclipse/jetty/server/session/SessionRenewTest.java index f61321a0e18..e9045bc3d6f 100644 --- a/tests/test-sessions/test-hash-sessions/src/test/java/org/eclipse/jetty/server/session/SessionRenewTest.java +++ b/tests/test-sessions/test-hash-sessions/src/test/java/org/eclipse/jetty/server/session/SessionRenewTest.java @@ -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 diff --git a/tests/test-sessions/test-hash-sessions/src/test/java/org/eclipse/jetty/server/session/SessionValueSharedSaving.java b/tests/test-sessions/test-hash-sessions/src/test/java/org/eclipse/jetty/server/session/SessionValueSharedSaving.java index 3b34d7a967f..2cd7cca98e4 100644 --- a/tests/test-sessions/test-hash-sessions/src/test/java/org/eclipse/jetty/server/session/SessionValueSharedSaving.java +++ b/tests/test-sessions/test-hash-sessions/src/test/java/org/eclipse/jetty/server/session/SessionValueSharedSaving.java @@ -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); } } diff --git a/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/ImmortalSessionTest.java b/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/ImmortalSessionTest.java index b6dcc111429..6b61d55d824 100644 --- a/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/ImmortalSessionTest.java +++ b/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/ImmortalSessionTest.java @@ -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 diff --git a/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/InfinispanTestSessionServer.java b/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/InfinispanTestSessionServer.java index a17f44bae19..ccdf37e17d7 100644 --- a/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/InfinispanTestSessionServer.java +++ b/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/InfinispanTestSessionServer.java @@ -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); } diff --git a/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/LastAccessTimeTest.java b/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/LastAccessTimeTest.java index 128a2c8e6ac..767164f7f6c 100644 --- a/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/LastAccessTimeTest.java +++ b/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/LastAccessTimeTest.java @@ -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 diff --git a/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/LocalSessionScavengingTest.java b/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/LocalSessionScavengingTest.java index cf318ab7eba..cb6682e80f2 100644 --- a/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/LocalSessionScavengingTest.java +++ b/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/LocalSessionScavengingTest.java @@ -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()); } } diff --git a/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/NewSessionTest.java b/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/NewSessionTest.java index 383bb7fab8f..825e862df20 100644 --- a/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/NewSessionTest.java +++ b/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/NewSessionTest.java @@ -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()); } diff --git a/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/ReentrantRequestSessionTest.java b/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/ReentrantRequestSessionTest.java index 65e9a56aaee..c2ffc9e76fd 100644 --- a/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/ReentrantRequestSessionTest.java +++ b/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/ReentrantRequestSessionTest.java @@ -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 diff --git a/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/RemoveSessionTest.java b/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/RemoveSessionTest.java index 9e34fdd377a..d8ae36a0787 100644 --- a/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/RemoveSessionTest.java +++ b/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/RemoveSessionTest.java @@ -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; } diff --git a/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/SameNodeLoadTest.java b/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/SameNodeLoadTest.java index a20787949f2..7d783fd9916 100644 --- a/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/SameNodeLoadTest.java +++ b/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/SameNodeLoadTest.java @@ -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; } diff --git a/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/SessionExpiryTest.java b/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/SessionExpiryTest.java index 0f51bb519a6..a7b6941ff8f 100644 --- a/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/SessionExpiryTest.java +++ b/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/SessionExpiryTest.java @@ -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; } diff --git a/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/SessionInvalidateAndCreateTest.java b/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/SessionInvalidateAndCreateTest.java index 4c130d55913..ab26d8bc126 100644 --- a/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/SessionInvalidateAndCreateTest.java +++ b/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/SessionInvalidateAndCreateTest.java @@ -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 diff --git a/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/SessionRenewTest.java b/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/SessionRenewTest.java index b34b341c02a..3ddabe286d1 100644 --- a/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/SessionRenewTest.java +++ b/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/SessionRenewTest.java @@ -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 diff --git a/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/remote/RemoteImmortalSessionTest.java b/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/remote/RemoteImmortalSessionTest.java index 8817e00d92c..a406bd7d5e2 100644 --- a/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/remote/RemoteImmortalSessionTest.java +++ b/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/remote/RemoteImmortalSessionTest.java @@ -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 diff --git a/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/remote/RemoteInvalidationSessionTest.java b/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/remote/RemoteInvalidationSessionTest.java index a4ac5d2b4ad..6025470caa1 100644 --- a/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/remote/RemoteInvalidationSessionTest.java +++ b/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/remote/RemoteInvalidationSessionTest.java @@ -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()); } diff --git a/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/remote/RemoteLastAccessTimeTest.java b/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/remote/RemoteLastAccessTimeTest.java index ebdae56fbec..a1625ba9818 100644 --- a/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/remote/RemoteLastAccessTimeTest.java +++ b/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/remote/RemoteLastAccessTimeTest.java @@ -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 diff --git a/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/remote/RemoteLocalSessionScavengingTest.java b/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/remote/RemoteLocalSessionScavengingTest.java index fad508c79fb..adb2f953960 100644 --- a/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/remote/RemoteLocalSessionScavengingTest.java +++ b/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/remote/RemoteLocalSessionScavengingTest.java @@ -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()); } } diff --git a/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/remote/RemoteNewSessionTest.java b/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/remote/RemoteNewSessionTest.java index 2d2bbf3c36d..4b294edea3b 100644 --- a/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/remote/RemoteNewSessionTest.java +++ b/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/remote/RemoteNewSessionTest.java @@ -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()); } diff --git a/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/remote/RemoteReentrantRequestSessionTest.java b/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/remote/RemoteReentrantRequestSessionTest.java index 00436f9ea40..4bb915d4ce9 100644 --- a/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/remote/RemoteReentrantRequestSessionTest.java +++ b/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/remote/RemoteReentrantRequestSessionTest.java @@ -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 diff --git a/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/remote/RemoteRemoveSessionTest.java b/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/remote/RemoteRemoveSessionTest.java index 23cd6791552..cda9acb654d 100644 --- a/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/remote/RemoteRemoveSessionTest.java +++ b/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/remote/RemoteRemoveSessionTest.java @@ -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; } diff --git a/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/remote/RemoteSameNodeLoadTest.java b/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/remote/RemoteSameNodeLoadTest.java index 6b143690706..0a49f3155a4 100644 --- a/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/remote/RemoteSameNodeLoadTest.java +++ b/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/remote/RemoteSameNodeLoadTest.java @@ -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; } diff --git a/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/remote/RemoteSessionExpiryTest.java b/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/remote/RemoteSessionExpiryTest.java index eec2b1a6164..e0d2d4dae9f 100644 --- a/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/remote/RemoteSessionExpiryTest.java +++ b/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/remote/RemoteSessionExpiryTest.java @@ -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; } diff --git a/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/remote/RemoteSessionInvalidateAndCreateTest.java b/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/remote/RemoteSessionInvalidateAndCreateTest.java index 48edd3ae165..8f1af7b44a1 100644 --- a/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/remote/RemoteSessionInvalidateAndCreateTest.java +++ b/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/remote/RemoteSessionInvalidateAndCreateTest.java @@ -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 diff --git a/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/remote/RemoteSessionRenewTest.java b/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/remote/RemoteSessionRenewTest.java index f5bed51fb98..6c41761ebde 100644 --- a/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/remote/RemoteSessionRenewTest.java +++ b/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/remote/RemoteSessionRenewTest.java @@ -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 diff --git a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/DirtyAttributeTest.java b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/DirtyAttributeTest.java index 6cf9cee8f09..7922a25fda8 100644 --- a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/DirtyAttributeTest.java +++ b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/DirtyAttributeTest.java @@ -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"); diff --git a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/ImmortalSessionTest.java b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/ImmortalSessionTest.java index 0ca802581ad..bd6a20e9f2a 100644 --- a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/ImmortalSessionTest.java +++ b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/ImmortalSessionTest.java @@ -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 diff --git a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/InvalidationSessionTest.java b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/InvalidationSessionTest.java index aa48973fec9..fb28bdb18ae 100644 --- a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/InvalidationSessionTest.java +++ b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/InvalidationSessionTest.java @@ -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() diff --git a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/JdbcTestServer.java b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/JdbcTestServer.java index 5ec0ac44dda..2e0829eac36 100644 --- a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/JdbcTestServer.java +++ b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/JdbcTestServer.java @@ -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); diff --git a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/LastAccessTimeTest.java b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/LastAccessTimeTest.java index 365bf388067..d16eaa6c2c4 100644 --- a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/LastAccessTimeTest.java +++ b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/LastAccessTimeTest.java @@ -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 diff --git a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/LocalSessionScavengingTest.java b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/LocalSessionScavengingTest.java index ddb7956cb9b..78533fc962d 100644 --- a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/LocalSessionScavengingTest.java +++ b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/LocalSessionScavengingTest.java @@ -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 diff --git a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/MaxInactiveMigrationTest.java b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/MaxInactiveMigrationTest.java index 11dd9261391..f07ca6c72c1 100644 --- a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/MaxInactiveMigrationTest.java +++ b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/MaxInactiveMigrationTest.java @@ -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(""); diff --git a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/ModifyMaxInactiveIntervalTest.java b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/ModifyMaxInactiveIntervalTest.java index 506ee4913e2..fdb221f957a 100644 --- a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/ModifyMaxInactiveIntervalTest.java +++ b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/ModifyMaxInactiveIntervalTest.java @@ -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"); diff --git a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/NewSessionTest.java b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/NewSessionTest.java index fb771d5f8a9..5d9e16f1999 100644 --- a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/NewSessionTest.java +++ b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/NewSessionTest.java @@ -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 diff --git a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/OrphanedSessionTest.java b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/OrphanedSessionTest.java index f0932f14126..44fda28d623 100644 --- a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/OrphanedSessionTest.java +++ b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/OrphanedSessionTest.java @@ -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 diff --git a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/ProxySerializationTest.java b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/ProxySerializationTest.java index 3d452406913..14957ca70fd 100644 --- a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/ProxySerializationTest.java +++ b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/ProxySerializationTest.java @@ -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); } /** diff --git a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/ReentrantRequestSessionTest.java b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/ReentrantRequestSessionTest.java index 2a99ea6ae2c..9fead19f2c8 100644 --- a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/ReentrantRequestSessionTest.java +++ b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/ReentrantRequestSessionTest.java @@ -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 diff --git a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/SaveIntervalTest.java b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/SaveIntervalTest.java index caf8b215b90..35474e5b271 100644 --- a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/SaveIntervalTest.java +++ b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/SaveIntervalTest.java @@ -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(); diff --git a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/SessionExpiryTest.java b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/SessionExpiryTest.java index 87e65c01d94..6f9548e2b91 100644 --- a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/SessionExpiryTest.java +++ b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/SessionExpiryTest.java @@ -36,9 +36,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 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 diff --git a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/SessionInvalidateAndCreateTest.java b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/SessionInvalidateAndCreateTest.java index 32821339975..c0034a85d75 100644 --- a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/SessionInvalidateAndCreateTest.java +++ b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/SessionInvalidateAndCreateTest.java @@ -26,9 +26,9 @@ public class SessionInvalidateAndCreateTest extends AbstractSessionInvalidateAnd { @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); } @Test diff --git a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/SessionRenewTest.java b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/SessionRenewTest.java index c891464d2c1..38535822bc9 100644 --- a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/SessionRenewTest.java +++ b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/SessionRenewTest.java @@ -30,9 +30,9 @@ public class SessionRenewTest extends AbstractSessionRenewTest { @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); } diff --git a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/SessionValueSavingTest.java b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/SessionValueSavingTest.java index b7505b91810..bdb55980734 100644 --- a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/SessionValueSavingTest.java +++ b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/SessionValueSavingTest.java @@ -26,9 +26,9 @@ import org.junit.Test; */ public class SessionValueSavingTest extends AbstractSessionValueSavingTest { - 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 diff --git a/tests/test-sessions/test-mongodb-sessions/src/test/java/org/eclipse/jetty/nosql/mongodb/AttributeNameTest.java b/tests/test-sessions/test-mongodb-sessions/src/test/java/org/eclipse/jetty/nosql/mongodb/AttributeNameTest.java index 0795be4cc14..59ea3f3949b 100644 --- a/tests/test-sessions/test-mongodb-sessions/src/test/java/org/eclipse/jetty/nosql/mongodb/AttributeNameTest.java +++ b/tests/test-sessions/test-mongodb-sessions/src/test/java/org/eclipse/jetty/nosql/mongodb/AttributeNameTest.java @@ -64,10 +64,10 @@ public class AttributeNameTest MongoTestServer.dropCollection(); } - public AbstractTestServer createServer(int port, int max, int scavenge, int inspect, int idlePassivate) + public AbstractTestServer createServer(int port, int max, int scavenge, int idlePassivate) throws Exception { - MongoTestServer server = new MongoTestServer(port,max,scavenge,inspect, idlePassivate, true); + MongoTestServer server = new MongoTestServer(port,max,scavenge,idlePassivate, true); return server; @@ -82,12 +82,12 @@ public class AttributeNameTest int scavengePeriod = 20000; int inspectPeriod = 60; int idlePassivatePeriod = -1; - AbstractTestServer server1 = createServer(0,maxInactivePeriod,scavengePeriod, inspectPeriod, idlePassivatePeriod); + AbstractTestServer server1 = createServer(0,maxInactivePeriod,scavengePeriod, idlePassivatePeriod); server1.addContext(contextPath).addServlet(TestServlet.class,servletMapping); server1.start(); int port1 = server1.getPort(); - AbstractTestServer server2 = createServer(0,maxInactivePeriod,scavengePeriod,inspectPeriod, idlePassivatePeriod); + AbstractTestServer server2 = createServer(0,maxInactivePeriod,scavengePeriod, idlePassivatePeriod); server2.addContext(contextPath).addServlet(TestServlet.class,servletMapping); server2.start(); int port2 = server2.getPort(); diff --git a/tests/test-sessions/test-mongodb-sessions/src/test/java/org/eclipse/jetty/nosql/mongodb/IdleSessionTest.java b/tests/test-sessions/test-mongodb-sessions/src/test/java/org/eclipse/jetty/nosql/mongodb/IdleSessionTest.java index c747be47a2c..e35bb472aee 100644 --- a/tests/test-sessions/test-mongodb-sessions/src/test/java/org/eclipse/jetty/nosql/mongodb/IdleSessionTest.java +++ b/tests/test-sessions/test-mongodb-sessions/src/test/java/org/eclipse/jetty/nosql/mongodb/IdleSessionTest.java @@ -43,9 +43,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, final int inspectSec, final int idleSec) + public AbstractTestServer createServer(final int port, final int max, final int scavenge, final int idleSec) { - return new MongoTestServer(port,max,scavenge, inspectSec, idleSec); + return new MongoTestServer(port,max,scavenge, idleSec); } /** diff --git a/tests/test-sessions/test-mongodb-sessions/src/test/java/org/eclipse/jetty/nosql/mongodb/InvalidateSessionTest.java b/tests/test-sessions/test-mongodb-sessions/src/test/java/org/eclipse/jetty/nosql/mongodb/InvalidateSessionTest.java index 08b502d444d..261067bb08c 100644 --- a/tests/test-sessions/test-mongodb-sessions/src/test/java/org/eclipse/jetty/nosql/mongodb/InvalidateSessionTest.java +++ b/tests/test-sessions/test-mongodb-sessions/src/test/java/org/eclipse/jetty/nosql/mongodb/InvalidateSessionTest.java @@ -44,9 +44,9 @@ public class InvalidateSessionTest extends AbstractInvalidationSessionTest } @Override - public AbstractTestServer createServer(int port, int maxInterval, int scavengeInterval, int inspectInterval, int idleInterval) + public AbstractTestServer createServer(int port, int maxInterval, int scavengeInterval, int idleInterval) { - return new MongoTestServer(port, maxInterval, scavengeInterval, inspectInterval, idleInterval); + return new MongoTestServer(port, maxInterval, scavengeInterval, idleInterval); } @Override diff --git a/tests/test-sessions/test-mongodb-sessions/src/test/java/org/eclipse/jetty/nosql/mongodb/LastAccessTimeTest.java b/tests/test-sessions/test-mongodb-sessions/src/test/java/org/eclipse/jetty/nosql/mongodb/LastAccessTimeTest.java index afc2a61ef32..0b422744dde 100644 --- a/tests/test-sessions/test-mongodb-sessions/src/test/java/org/eclipse/jetty/nosql/mongodb/LastAccessTimeTest.java +++ b/tests/test-sessions/test-mongodb-sessions/src/test/java/org/eclipse/jetty/nosql/mongodb/LastAccessTimeTest.java @@ -41,9 +41,9 @@ public class LastAccessTimeTest extends AbstractLastAccessTimeTest MongoTestServer.dropCollection(); } - public AbstractTestServer createServer(int port, int max, int scavenge, int inspectSec, int idlePassivateSec) + public AbstractTestServer createServer(int port, int max, int scavenge, int idlePassivateSec) { - return new MongoTestServer(port,max,scavenge, inspectSec, idlePassivateSec); + return new MongoTestServer(port,max,scavenge, idlePassivateSec); } diff --git a/tests/test-sessions/test-mongodb-sessions/src/test/java/org/eclipse/jetty/nosql/mongodb/LocalSessionScavengingTest.java b/tests/test-sessions/test-mongodb-sessions/src/test/java/org/eclipse/jetty/nosql/mongodb/LocalSessionScavengingTest.java index 2f278f970bb..985f32e284d 100644 --- a/tests/test-sessions/test-mongodb-sessions/src/test/java/org/eclipse/jetty/nosql/mongodb/LocalSessionScavengingTest.java +++ b/tests/test-sessions/test-mongodb-sessions/src/test/java/org/eclipse/jetty/nosql/mongodb/LocalSessionScavengingTest.java @@ -41,9 +41,9 @@ public class LocalSessionScavengingTest extends AbstractLocalSessionScavengingTe } @Override - public AbstractTestServer createServer(int port, int max, int scavenge, int inspectSec, int idlePassivateSec) + public AbstractTestServer createServer(int port, int max, int scavenge, int idlePassivateSec) { - MongoTestServer mserver=new MongoTestServer(port,max,scavenge, inspectSec, idlePassivateSec); + MongoTestServer mserver=new MongoTestServer(port,max,scavenge, idlePassivateSec); return mserver; } diff --git a/tests/test-sessions/test-mongodb-sessions/src/test/java/org/eclipse/jetty/nosql/mongodb/MongoTestServer.java b/tests/test-sessions/test-mongodb-sessions/src/test/java/org/eclipse/jetty/nosql/mongodb/MongoTestServer.java index db8d1ebced2..9dd81143025 100644 --- a/tests/test-sessions/test-mongodb-sessions/src/test/java/org/eclipse/jetty/nosql/mongodb/MongoTestServer.java +++ b/tests/test-sessions/test-mongodb-sessions/src/test/java/org/eclipse/jetty/nosql/mongodb/MongoTestServer.java @@ -63,20 +63,20 @@ public class MongoTestServer extends AbstractTestServer } - public MongoTestServer(int port, int inspectionPeriod, int idlePassivatePeriod) + public MongoTestServer(int port, int idlePassivatePeriod) { - super(port, 30, 10, inspectionPeriod, idlePassivatePeriod); + super(port, 30, 10, idlePassivatePeriod); } - public MongoTestServer(int port, int maxInactivePeriod, int scavengePeriod, int inspectionPeriod, int idlePassivatePeriod) + public MongoTestServer(int port, int maxInactivePeriod, int scavengePeriod,int idlePassivatePeriod) { - super(port, maxInactivePeriod, scavengePeriod, inspectionPeriod, idlePassivatePeriod); + super(port, maxInactivePeriod, scavengePeriod, idlePassivatePeriod); } - public MongoTestServer(int port, int maxInactivePeriod, int scavengePeriod, int inspectionPeriod, int idlePassivatePeriod, boolean saveAllAttributes) + public MongoTestServer(int port, int maxInactivePeriod, int scavengePeriod, int idlePassivatePeriod, boolean saveAllAttributes) { - super(port, maxInactivePeriod, scavengePeriod, inspectionPeriod, idlePassivatePeriod); + super(port, maxInactivePeriod, scavengePeriod, idlePassivatePeriod); } @@ -87,7 +87,7 @@ public class MongoTestServer extends AbstractTestServer { manager = new MongoSessionManager(); ((MongoSessionManager)manager).getSessionDataStore().setDBCollection(getCollection()); - manager.getSessionDataStore().setGracePeriodSec(_inspectionPeriod); + manager.getSessionDataStore().setGracePeriodSec(_scavengePeriod); } catch (Exception e) { diff --git a/tests/test-sessions/test-mongodb-sessions/src/test/java/org/eclipse/jetty/nosql/mongodb/NewSessionTest.java b/tests/test-sessions/test-mongodb-sessions/src/test/java/org/eclipse/jetty/nosql/mongodb/NewSessionTest.java index f0660886e87..cca043820ee 100644 --- a/tests/test-sessions/test-mongodb-sessions/src/test/java/org/eclipse/jetty/nosql/mongodb/NewSessionTest.java +++ b/tests/test-sessions/test-mongodb-sessions/src/test/java/org/eclipse/jetty/nosql/mongodb/NewSessionTest.java @@ -44,9 +44,9 @@ public class NewSessionTest extends AbstractNewSessionTest } - public AbstractTestServer createServer(int port, int max, int scavenge, int inspectSec, int idlePassivateSec) + public AbstractTestServer createServer(int port, int max, int scavenge, int idlePassivateSec) { - return new MongoTestServer(port,max,scavenge, inspectSec, idlePassivateSec); + return new MongoTestServer(port,max,scavenge, idlePassivateSec); } @Test diff --git a/tests/test-sessions/test-mongodb-sessions/src/test/java/org/eclipse/jetty/nosql/mongodb/OrphanedSessionTest.java b/tests/test-sessions/test-mongodb-sessions/src/test/java/org/eclipse/jetty/nosql/mongodb/OrphanedSessionTest.java index 3a5aeabbb61..bdbb63f45cb 100644 --- a/tests/test-sessions/test-mongodb-sessions/src/test/java/org/eclipse/jetty/nosql/mongodb/OrphanedSessionTest.java +++ b/tests/test-sessions/test-mongodb-sessions/src/test/java/org/eclipse/jetty/nosql/mongodb/OrphanedSessionTest.java @@ -44,9 +44,9 @@ public class OrphanedSessionTest extends AbstractOrphanedSessionTest } - public AbstractTestServer createServer(int port, int max, int scavenge, int inspectSec, int idlePassivateSec) + public AbstractTestServer createServer(int port, int max, int scavenge, int idlePassivateSec) { - return new MongoTestServer(port,max,scavenge, inspectSec, idlePassivateSec); + return new MongoTestServer(port,max,scavenge, idlePassivateSec); } @Test diff --git a/tests/test-sessions/test-mongodb-sessions/src/test/java/org/eclipse/jetty/nosql/mongodb/ReentrantRequestSessionTest.java b/tests/test-sessions/test-mongodb-sessions/src/test/java/org/eclipse/jetty/nosql/mongodb/ReentrantRequestSessionTest.java index 6d5b0bac648..fa1ea0de8ae 100644 --- a/tests/test-sessions/test-mongodb-sessions/src/test/java/org/eclipse/jetty/nosql/mongodb/ReentrantRequestSessionTest.java +++ b/tests/test-sessions/test-mongodb-sessions/src/test/java/org/eclipse/jetty/nosql/mongodb/ReentrantRequestSessionTest.java @@ -52,12 +52,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 MongoTestServer(port, max, scavenge, inspectionPeriod, idlePassivatePeriod); + return new MongoTestServer(port, max, scavenge, idlePassivatePeriod); } } diff --git a/tests/test-sessions/test-mongodb-sessions/src/test/java/org/eclipse/jetty/nosql/mongodb/RemoveSessionTest.java b/tests/test-sessions/test-mongodb-sessions/src/test/java/org/eclipse/jetty/nosql/mongodb/RemoveSessionTest.java index 15fb3636cb3..b5be9662359 100644 --- a/tests/test-sessions/test-mongodb-sessions/src/test/java/org/eclipse/jetty/nosql/mongodb/RemoveSessionTest.java +++ b/tests/test-sessions/test-mongodb-sessions/src/test/java/org/eclipse/jetty/nosql/mongodb/RemoveSessionTest.java @@ -41,9 +41,9 @@ public class RemoveSessionTest extends AbstractRemoveSessionTest MongoTestServer.dropCollection(); } - 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 MongoTestServer(port,max,scavenge, inspect, idlePassivate); + return new MongoTestServer(port,max,scavenge, idlePassivate); } @Test diff --git a/tests/test-sessions/test-mongodb-sessions/src/test/java/org/eclipse/jetty/nosql/mongodb/SessionExpiryTest.java b/tests/test-sessions/test-mongodb-sessions/src/test/java/org/eclipse/jetty/nosql/mongodb/SessionExpiryTest.java index 29bf9557d67..a86f24b6c13 100644 --- a/tests/test-sessions/test-mongodb-sessions/src/test/java/org/eclipse/jetty/nosql/mongodb/SessionExpiryTest.java +++ b/tests/test-sessions/test-mongodb-sessions/src/test/java/org/eclipse/jetty/nosql/mongodb/SessionExpiryTest.java @@ -69,9 +69,9 @@ public class SessionExpiryTest extends AbstractSessionExpiryTest } @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 MongoTestServer(port,max,scavenge, inspect, idlePassivate); + return new MongoTestServer(port,max,scavenge, idlePassivate); } @Test @@ -93,9 +93,8 @@ public class SessionExpiryTest extends AbstractSessionExpiryTest String servletMapping = "/server"; int inactivePeriod = Integer.MAX_VALUE * 60; //integer overflow int scavengePeriod = 10; - int inspectPeriod = 1; int idlePassivatePeriod = 0; - AbstractTestServer server1 = createServer(0, inactivePeriod, scavengePeriod, inspectPeriod, idlePassivatePeriod); + AbstractTestServer server1 = createServer(0, inactivePeriod, scavengePeriod, idlePassivatePeriod); ChangeTimeoutServlet servlet = new ChangeTimeoutServlet(); ServletHolder holder = new ServletHolder(servlet); ServletContextHandler context = server1.addContext(contextPath); @@ -126,7 +125,7 @@ public class SessionExpiryTest extends AbstractSessionExpiryTest DBCollection sessions = MongoTestServer.getCollection(); verifySessionCreated(listener,sessionId); //verify that the session timeout is set in mongo - verifySessionTimeout(sessions, sessionId, -1); //SessionManager sets -1 if maxInactive < 0 + verifySessionTimeout(sessions, sessionId, -1000); //SessionManager sets -1 if maxInactive < 0 //get the session expiry time from mongo long expiry = getSessionExpiry(sessions, sessionId); @@ -146,9 +145,8 @@ public class SessionExpiryTest extends AbstractSessionExpiryTest String servletMapping = "/server"; int inactivePeriod = 10; int scavengePeriod = 1; - int inspectPeriod = 1; int idlePassivatePeriod = 0; - AbstractTestServer server1 = createServer(0, inactivePeriod, scavengePeriod, inspectPeriod, idlePassivatePeriod); + AbstractTestServer server1 = createServer(0, inactivePeriod, scavengePeriod, idlePassivatePeriod); ChangeTimeoutServlet servlet = new ChangeTimeoutServlet(); ServletHolder holder = new ServletHolder(servlet); ServletContextHandler context = server1.addContext(contextPath); @@ -183,7 +181,6 @@ public class SessionExpiryTest extends AbstractSessionExpiryTest //get the session expiry time from mongo long expiry = getSessionExpiry(sessions, sessionId); - //make another request to change the session timeout to a smaller value inactivePeriod = 5; Request request = client.newRequest(url + "?action=change&val="+inactivePeriod); @@ -206,7 +203,10 @@ public class SessionExpiryTest extends AbstractSessionExpiryTest assertEquals(HttpServletResponse.SC_OK,response2.getStatus()); //verify that the session timeout is set in mongo verifySessionTimeout(sessions, sessionId, inactivePeriod); - assertTrue(getSessionAccessed(sessions, sessionId)+ (1000L*inactivePeriod) == getSessionExpiry(sessions, sessionId)); + long latestExpiry = getSessionExpiry(sessions, sessionId); + assertTrue (latestExpiry > expiry); + assertTrue(getSessionAccessed(sessions, sessionId)+ (1000L*inactivePeriod) <= getSessionExpiry(sessions, sessionId)); + assertTrue (latestExpiry >= 15);//old inactive expired in 5, new inactive expired in 20 } finally { @@ -224,7 +224,7 @@ public class SessionExpiryTest extends AbstractSessionExpiryTest int scavengePeriod = 1; int inspectPeriod = 1; int idlePassivatePeriod = 0; - AbstractTestServer server1 = createServer(0, inactivePeriod, scavengePeriod,inspectPeriod, idlePassivatePeriod); + AbstractTestServer server1 = createServer(0, inactivePeriod, scavengePeriod,idlePassivatePeriod); ImmediateChangeTimeoutServlet servlet = new ImmediateChangeTimeoutServlet(); ServletHolder holder = new ServletHolder(servlet); ServletContextHandler context = server1.addContext(contextPath); diff --git a/tests/test-sessions/test-mongodb-sessions/src/test/java/org/eclipse/jetty/nosql/mongodb/SessionInvalidateAndCreateTest.java b/tests/test-sessions/test-mongodb-sessions/src/test/java/org/eclipse/jetty/nosql/mongodb/SessionInvalidateAndCreateTest.java index df4eb8d40c4..61d562561b4 100644 --- a/tests/test-sessions/test-mongodb-sessions/src/test/java/org/eclipse/jetty/nosql/mongodb/SessionInvalidateAndCreateTest.java +++ b/tests/test-sessions/test-mongodb-sessions/src/test/java/org/eclipse/jetty/nosql/mongodb/SessionInvalidateAndCreateTest.java @@ -42,9 +42,9 @@ public class SessionInvalidateAndCreateTest extends AbstractSessionInvalidateAnd } @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 MongoTestServer(port,max,scavenge, inspect, idlePassivate); + return new MongoTestServer(port,max,scavenge,idlePassivate); } diff --git a/tests/test-sessions/test-mongodb-sessions/src/test/java/org/eclipse/jetty/nosql/mongodb/SessionRenewTest.java b/tests/test-sessions/test-mongodb-sessions/src/test/java/org/eclipse/jetty/nosql/mongodb/SessionRenewTest.java index 98499d85291..1ae47904724 100644 --- a/tests/test-sessions/test-mongodb-sessions/src/test/java/org/eclipse/jetty/nosql/mongodb/SessionRenewTest.java +++ b/tests/test-sessions/test-mongodb-sessions/src/test/java/org/eclipse/jetty/nosql/mongodb/SessionRenewTest.java @@ -49,9 +49,9 @@ public class SessionRenewTest extends AbstractSessionRenewTest } @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 MongoTestServer(port, max, scavenge, inspect, idlePassivate); + return new MongoTestServer(port, max, scavenge, idlePassivate); } @Test diff --git a/tests/test-sessions/test-mongodb-sessions/src/test/java/org/eclipse/jetty/nosql/mongodb/SessionSavingValueTest.java b/tests/test-sessions/test-mongodb-sessions/src/test/java/org/eclipse/jetty/nosql/mongodb/SessionSavingValueTest.java index a586a96f880..9defa60b3a7 100644 --- a/tests/test-sessions/test-mongodb-sessions/src/test/java/org/eclipse/jetty/nosql/mongodb/SessionSavingValueTest.java +++ b/tests/test-sessions/test-mongodb-sessions/src/test/java/org/eclipse/jetty/nosql/mongodb/SessionSavingValueTest.java @@ -42,9 +42,9 @@ public class SessionSavingValueTest extends AbstractSessionValueSavingTest } @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 MongoTestServer(port, max, scavenge, inspect, idlePassivate); + return new MongoTestServer(port, max, scavenge, idlePassivate); } @Test diff --git a/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractIdleSessionTest.java b/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractIdleSessionTest.java index 6658f81b2b6..680944d700e 100644 --- a/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractIdleSessionTest.java +++ b/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractIdleSessionTest.java @@ -67,7 +67,7 @@ public abstract class AbstractIdleSessionTest * @param idleSec * @return */ - public abstract AbstractTestServer createServer (int port, int max, int scavenge, int inspectPeriod, int idleSec); + public abstract AbstractTestServer createServer (int port, int max, int scavenge, int idleSec); /** @@ -118,10 +118,10 @@ public abstract class AbstractIdleSessionTest int inactivePeriod = 20; int scavengePeriod = 3; int idlePeriod = 5; - int inspectPeriod = 1; + - _server1 = createServer(0, inactivePeriod, scavengePeriod, inspectPeriod, idlePeriod); + _server1 = createServer(0, inactivePeriod, scavengePeriod, idlePeriod); ServletHolder holder = new ServletHolder(_servlet); ServletContextHandler contextHandler = _server1.addContext(contextPath); contextHandler.addServlet(holder, servletMapping); @@ -143,8 +143,7 @@ public abstract class AbstractIdleSessionTest sessionCookie = sessionCookie.replaceFirst("(\\W)(P|p)ath=", "$1\\$Path="); //and wait until the session should be idled out - pause(idlePeriod * 2); - + pause(idlePeriod*3); //check that the session has been idled checkSessionIdled(AbstractTestServer.extractSessionId(sessionCookie)); @@ -159,7 +158,7 @@ public abstract class AbstractIdleSessionTest checkSessionDeIdled(AbstractTestServer.extractSessionId(sessionCookie)); //wait again for the session to be idled - pause(idlePeriod * 2); + pause(idlePeriod*3); //check that it is checkSessionIdled(AbstractTestServer.extractSessionId(sessionCookie)); @@ -167,6 +166,7 @@ public abstract class AbstractIdleSessionTest //While idle, take some action to ensure that a deidle won't work, like //deleting all sessions in mongo deleteSessionData(AbstractTestServer.extractSessionId(sessionCookie)); + //make a request request = client.newRequest(url + "?action=testfail"); @@ -185,7 +185,7 @@ public abstract class AbstractIdleSessionTest sessionCookie = sessionCookie.replaceFirst("(\\W)(P|p)ath=", "$1\\$Path="); //and wait until the session should be idled out - pause(idlePeriod * 2); + pause(idlePeriod * 3); //stop the scavenger if (_server1.getInspector() != null) @@ -195,7 +195,7 @@ public abstract class AbstractIdleSessionTest checkSessionIdled(AbstractTestServer.extractSessionId(sessionCookie)); //wait until the session should be expired - pause (inactivePeriod + (inactivePeriod/2)); + pause (inactivePeriod + (3*scavengePeriod)); //make another request to de-idle the session request = client.newRequest(url + "?action=testfail"); diff --git a/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractImmortalSessionTest.java b/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractImmortalSessionTest.java index b1a3c6c289b..40cc740f183 100644 --- a/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractImmortalSessionTest.java +++ b/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractImmortalSessionTest.java @@ -43,7 +43,7 @@ import org.junit.Test; */ public abstract class AbstractImmortalSessionTest { - public abstract AbstractTestServer createServer(int port, int maxInactiveMs, int scavengeMs, int inspectPeriod, int idlePassivatePeriod); + public abstract AbstractTestServer createServer(int port, int maxInactiveMs, int scavengeMs, int idlePassivatePeriod); @Test public void testImmortalSession() throws Exception @@ -51,10 +51,9 @@ public abstract class AbstractImmortalSessionTest String contextPath = ""; String servletMapping = "/server"; int scavengePeriod = 2; - int inspectPeriod = 1; int idlePeriod = -1; //turn off session expiry by setting maxInactiveInterval to -1 - AbstractTestServer server = createServer(0, -1, scavengePeriod, inspectPeriod, idlePeriod); + AbstractTestServer server = createServer(0, -1, scavengePeriod, idlePeriod); ServletContextHandler context = server.addContext(contextPath); context.addServlet(TestServlet.class, servletMapping); diff --git a/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractInvalidationSessionTest.java b/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractInvalidationSessionTest.java index bafb5c596b3..3573da6307d 100644 --- a/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractInvalidationSessionTest.java +++ b/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractInvalidationSessionTest.java @@ -43,7 +43,7 @@ import org.junit.Test; */ public abstract class AbstractInvalidationSessionTest { - public abstract AbstractTestServer createServer(int port, int maxInactive, int scavengeInterval, int inspectInterval, int idlePassivatePeriod); + public abstract AbstractTestServer createServer(int port, int maxInactive, int scavengeInterval, int idlePassivatePeriod); public abstract void pause(); @Test @@ -51,7 +51,7 @@ public abstract class AbstractInvalidationSessionTest { String contextPath = ""; String servletMapping = "/server"; - AbstractTestServer server1 = createServer(0, 30, 1, 1, 1); + AbstractTestServer server1 = createServer(0, 30, 1, 1); server1.addContext(contextPath).addServlet(TestServlet.class, servletMapping); @@ -59,7 +59,7 @@ public abstract class AbstractInvalidationSessionTest { server1.start(); int port1 = server1.getPort(); - AbstractTestServer server2 = createServer(0, 30, 1, 1, 1); + AbstractTestServer server2 = createServer(0, 30, 1, 1); server2.addContext(contextPath).addServlet(TestServlet.class, servletMapping); try diff --git a/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractLastAccessTimeTest.java b/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractLastAccessTimeTest.java index 05b01a21325..00d07919429 100644 --- a/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractLastAccessTimeTest.java +++ b/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractLastAccessTimeTest.java @@ -54,7 +54,7 @@ import org.junit.Test; public abstract class AbstractLastAccessTimeTest { - public abstract AbstractTestServer createServer(int port, int max, int scavenge, int inspectionPeriod, int idlePassivatePeriod); + public abstract AbstractTestServer createServer(int port, int max, int scavenge, int idlePassivatePeriod); @@ -64,10 +64,9 @@ public abstract class AbstractLastAccessTimeTest String contextPath = ""; String servletMapping = "/server"; int maxInactivePeriod = 8; //session will timeout after 8 seconds - int inspectionPeriod = 2; //periodic inspections every 2 sec int scavengePeriod = 2; //scavenging occurs every 2 seconds int idlePassivatePeriod = -1; //dont check for idle sessions to passivate - AbstractTestServer server1 = createServer(0, maxInactivePeriod, scavengePeriod, inspectionPeriod, idlePassivatePeriod); + AbstractTestServer server1 = createServer(0, maxInactivePeriod, scavengePeriod, idlePassivatePeriod); TestServlet servlet1 = new TestServlet(); ServletHolder holder1 = new ServletHolder(servlet1); ServletContextHandler context = server1.addContext(contextPath); @@ -81,7 +80,7 @@ public abstract class AbstractLastAccessTimeTest { server1.start(); int port1=server1.getPort(); - AbstractTestServer server2 = createServer(0, maxInactivePeriod, scavengePeriod, inspectionPeriod, idlePassivatePeriod); + AbstractTestServer server2 = createServer(0, maxInactivePeriod, scavengePeriod, idlePassivatePeriod); ServletContextHandler context2 = server2.addContext(contextPath); context2.addServlet(TestServlet.class, servletMapping); SessionManager m2 = (SessionManager)context2.getSessionHandler().getSessionManager(); diff --git a/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractLocalSessionScavengingTest.java b/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractLocalSessionScavengingTest.java index 5653c096788..e7d5d3a7de2 100644 --- a/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractLocalSessionScavengingTest.java +++ b/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractLocalSessionScavengingTest.java @@ -41,7 +41,7 @@ import org.junit.Test; */ public abstract class AbstractLocalSessionScavengingTest { - public abstract AbstractTestServer createServer(int port, int max, int scavenge, int inspectionPeriod, int idlePeriod); + public abstract AbstractTestServer createServer(int port, int max, int scavenge, int idlePeriod); public void pause(int scavengePeriod) { @@ -64,7 +64,7 @@ public abstract class AbstractLocalSessionScavengingTest int scavengePeriod = 2; int inspectionPeriod = 2; int idlePeriod = 20; - AbstractTestServer server1 = createServer(0, inactivePeriod, scavengePeriod, inspectionPeriod, idlePeriod); + AbstractTestServer server1 = createServer(0, inactivePeriod, scavengePeriod, idlePeriod); ServletContextHandler context1 = server1.addContext(contextPath); context1.addServlet(TestServlet.class, servletMapping); @@ -72,7 +72,7 @@ public abstract class AbstractLocalSessionScavengingTest { server1.start(); int port1 = server1.getPort(); - AbstractTestServer server2 = createServer(0, inactivePeriod, scavengePeriod * 3, inspectionPeriod, idlePeriod); + AbstractTestServer server2 = createServer(0, inactivePeriod, scavengePeriod * 3, idlePeriod); ServletContextHandler context2 = server2.addContext(contextPath); context2.addServlet(TestServlet.class, servletMapping); diff --git a/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractNewSessionTest.java b/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractNewSessionTest.java index 70e47dfc71d..dff96f761b1 100644 --- a/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractNewSessionTest.java +++ b/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractNewSessionTest.java @@ -43,7 +43,7 @@ import org.junit.Test; */ public abstract class AbstractNewSessionTest { - public abstract AbstractTestServer createServer(int port, int max, int scavenge, int inspectPeriod, int idlePassivatePeriod); + public abstract AbstractTestServer createServer(int port, int max, int scavenge, int idlePassivatePeriod); public void pause(int scavenge) { @@ -62,7 +62,7 @@ public abstract class AbstractNewSessionTest { String servletMapping = "/server"; int scavengePeriod = 3; - AbstractTestServer server = createServer(0, 1, scavengePeriod, 1, 4); + AbstractTestServer server = createServer(0, 1, scavengePeriod, 4); ServletContextHandler context = server.addContext("/"); context.addServlet(TestServlet.class, servletMapping); String contextPath = ""; diff --git a/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractOrphanedSessionTest.java b/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractOrphanedSessionTest.java index ac47401c924..367d2ad3ec6 100644 --- a/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractOrphanedSessionTest.java +++ b/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractOrphanedSessionTest.java @@ -41,7 +41,7 @@ import org.junit.Test; public abstract class AbstractOrphanedSessionTest { - public abstract AbstractTestServer createServer(int port, int max, int scavenge, int inspectInterval, int idlePassivateInterval); + public abstract AbstractTestServer createServer(int port, int max, int scavenge, int idlePassivateInterval); /** * If nodeA creates a session, and just afterwards crashes, it is the only node that knows about the session. @@ -55,14 +55,14 @@ public abstract class AbstractOrphanedSessionTest String contextPath = ""; String servletMapping = "/server"; int inactivePeriod = 5; - AbstractTestServer server1 = createServer(0, inactivePeriod, -1, 1, -1); + AbstractTestServer server1 = createServer(0, inactivePeriod, -1, -1); server1.addContext(contextPath).addServlet(TestServlet.class, servletMapping); try { server1.start(); int port1 = server1.getPort(); int scavengePeriod = 2; - AbstractTestServer server2 = createServer(0, inactivePeriod, scavengePeriod, 1, 2); + AbstractTestServer server2 = createServer(0, inactivePeriod, scavengePeriod, 2); server2.addContext(contextPath).addServlet(TestServlet.class, servletMapping); try { diff --git a/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractProxySerializationTest.java b/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractProxySerializationTest.java index fc6b807da6a..098ded2310a 100644 --- a/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractProxySerializationTest.java +++ b/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractProxySerializationTest.java @@ -46,7 +46,7 @@ import org.junit.Test; */ public abstract class AbstractProxySerializationTest { - public abstract AbstractTestServer createServer(int port, int max, int scavenge, int ispectPeriod, int idlePassivatePeriod); + public abstract AbstractTestServer createServer(int port, int max, int scavenge, int idlePassivatePeriod); public abstract void customizeContext (ServletContextHandler c); @@ -73,7 +73,7 @@ public abstract class AbstractProxySerializationTest String contextPath = ""; String servletMapping = "/server"; int scavengePeriod = 10; - AbstractTestServer server = createServer(0, 20, scavengePeriod, 1, 20); + AbstractTestServer server = createServer(0, 20, scavengePeriod, 20); ServletContextHandler context = server.addContext(contextPath); InputStream is = this.getClass().getClassLoader().getResourceAsStream("proxy-serialization.jar"); diff --git a/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractReentrantRequestSessionTest.java b/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractReentrantRequestSessionTest.java index 0fc8c72fc9b..1d727eade4b 100644 --- a/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractReentrantRequestSessionTest.java +++ b/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractReentrantRequestSessionTest.java @@ -42,14 +42,14 @@ import org.junit.Test; */ public abstract class AbstractReentrantRequestSessionTest { - public abstract AbstractTestServer createServer(int port, int max, int scavenge, int inspectionPeriod, int idlePassivatePeriod); + public abstract AbstractTestServer createServer(int port, int max, int scavenge, int idlePassivatePeriod); @Test public void testReentrantRequestSession() throws Exception { String contextPath = ""; String servletMapping = "/server"; - AbstractTestServer server = createServer(0, 100, 400, 2, 10); + AbstractTestServer server = createServer(0, 100, 400, 10); server.addContext(contextPath).addServlet(TestServlet.class, servletMapping); try { diff --git a/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractRemoveSessionTest.java b/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractRemoveSessionTest.java index 1ebd6c9a36b..879c96ca469 100644 --- a/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractRemoveSessionTest.java +++ b/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractRemoveSessionTest.java @@ -47,7 +47,7 @@ import org.junit.Test; */ public abstract class AbstractRemoveSessionTest { - public abstract AbstractTestServer createServer(int port, int max, int scavenge, int inspectionPeriod, int idlePassivationPeriod); + public abstract AbstractTestServer createServer(int port, int max, int scavenge, int idlePassivationPeriod); @Test @@ -57,7 +57,7 @@ public abstract class AbstractRemoveSessionTest String servletMapping = "/server"; int scavengePeriod = 3; int inspectionPeriod = 1; - AbstractTestServer server = createServer(0, 1, scavengePeriod, inspectionPeriod, -1); + AbstractTestServer server = createServer(0, 1, scavengePeriod, -1); ServletContextHandler context = server.addContext(contextPath); context.addServlet(TestServlet.class, servletMapping); TestEventListener testListener = new TestEventListener(); diff --git a/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractSameNodeLoadTest.java b/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractSameNodeLoadTest.java index 111087b86da..8ca00599ab8 100644 --- a/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractSameNodeLoadTest.java +++ b/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractSameNodeLoadTest.java @@ -53,7 +53,7 @@ public abstract class AbstractSameNodeLoadTest protected boolean _stress = Boolean.getBoolean( "STRESS" ); - public abstract AbstractTestServer createServer(int port, int max, int scavenge, int inspectionPeriod, int idlePassivationPeriod); + public abstract AbstractTestServer createServer(int port, int max, int scavenge, int idlePassivationPeriod); @Test @@ -63,7 +63,7 @@ public abstract class AbstractSameNodeLoadTest { String contextPath = ""; String servletMapping = "/server"; - AbstractTestServer server1 = createServer(0, 20000, 4, 2, 1000); + AbstractTestServer server1 = createServer(0, 20000, 4, 1000); server1.addContext( contextPath ).addServlet( TestServlet.class, servletMapping ); try diff --git a/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractSessionCookieTest.java b/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractSessionCookieTest.java index e1cf75ccbf5..0f674aa3144 100644 --- a/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractSessionCookieTest.java +++ b/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractSessionCookieTest.java @@ -43,7 +43,7 @@ import junit.framework.Assert; */ public abstract class AbstractSessionCookieTest { - public abstract AbstractTestServer createServer(int port, int max, int scavenge, int inspectInterval, int idlePassivateInterval); + public abstract AbstractTestServer createServer(int port, int max, int scavenge, int idlePassivateInterval); public void pause(int scavenge) { @@ -66,7 +66,7 @@ public abstract class AbstractSessionCookieTest int scavengePeriod = 3; int inspectPeriod = 1; int idlePassivatePeriod = 10; - AbstractTestServer server = createServer(0, 1, scavengePeriod,inspectPeriod, idlePassivatePeriod); + AbstractTestServer server = createServer(0, 1, scavengePeriod,idlePassivatePeriod); ServletContextHandler context = server.addContext(contextPath); context.addServlet(TestServlet.class, servletMapping); diff --git a/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractSessionExpiryTest.java b/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractSessionExpiryTest.java index 7c447ee176e..c36d1024bb6 100644 --- a/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractSessionExpiryTest.java +++ b/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractSessionExpiryTest.java @@ -47,7 +47,7 @@ import org.junit.Test; */ public abstract class AbstractSessionExpiryTest { - public abstract AbstractTestServer createServer(int port, int max, int scavenge, int inspectionPeriod, int idlePassivationPeriod); + public abstract AbstractTestServer createServer(int port, int max, int scavenge, int idlePassivationPeriod); public void pause(int scavengePeriod) { @@ -87,7 +87,7 @@ public abstract class AbstractSessionExpiryTest int scavengePeriod = 10; int inspectPeriod = 1; int idlePassivatePeriod = 8; - AbstractTestServer server1 = createServer(0, inactivePeriod, scavengePeriod, inspectPeriod, idlePassivatePeriod); + AbstractTestServer server1 = createServer(0, inactivePeriod, scavengePeriod, idlePassivatePeriod); TestServlet servlet = new TestServlet(); ServletHolder holder = new ServletHolder(servlet); server1.addContext(contextPath).addServlet(holder, servletMapping); @@ -143,7 +143,7 @@ public abstract class AbstractSessionExpiryTest int inactivePeriod = 2; int scavengePeriod = 1; int inspectPeriod = 1; - AbstractTestServer server1 = createServer(0, inactivePeriod, scavengePeriod, inspectPeriod, -1); + AbstractTestServer server1 = createServer(0, inactivePeriod, scavengePeriod, -1); TestServlet servlet = new TestServlet(); ServletHolder holder = new ServletHolder(servlet); ServletContextHandler context = server1.addContext(contextPath); diff --git a/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractSessionInvalidateAndCreateTest.java b/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractSessionInvalidateAndCreateTest.java index da5b7c67ac5..08d1f81d414 100644 --- a/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractSessionInvalidateAndCreateTest.java +++ b/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractSessionInvalidateAndCreateTest.java @@ -73,7 +73,7 @@ public abstract class AbstractSessionInvalidateAndCreateTest } } - public abstract AbstractTestServer createServer(int port, int max, int scavenge, int inspectionPeriod, int idlePassivationPeriod); + public abstract AbstractTestServer createServer(int port, int max, int scavenge, int idlePassivationPeriod); @@ -96,9 +96,8 @@ public abstract class AbstractSessionInvalidateAndCreateTest String servletMapping = "/server"; int inactivePeriod = 1; int scavengePeriod = 2; - int inspectPeriod = 1; int idlePassivatePeriod = -1; - AbstractTestServer server = createServer(0, inactivePeriod, scavengePeriod, inspectPeriod, idlePassivatePeriod); + AbstractTestServer server = createServer(0, inactivePeriod, scavengePeriod, idlePassivatePeriod); ServletContextHandler context = server.addContext(contextPath); TestServlet servlet = new TestServlet(); ServletHolder holder = new ServletHolder(servlet); @@ -196,7 +195,7 @@ public abstract class AbstractSessionInvalidateAndCreateTest { //invalidate existing session session.invalidate(); - + //now try to access the invalid session try { diff --git a/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractSessionRenewTest.java b/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractSessionRenewTest.java index 8930f6de187..d2f5d98aad7 100644 --- a/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractSessionRenewTest.java +++ b/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractSessionRenewTest.java @@ -50,7 +50,7 @@ public abstract class AbstractSessionRenewTest { protected AbstractTestServer _server; - public abstract AbstractTestServer createServer(int port, int max, int scavenge, int inspectionPeriod, int idlePassivationPeriod); + public abstract AbstractTestServer createServer(int port, int max, int scavenge, int idlePassivationPeriod); public abstract boolean verifyChange (WebAppContext context, String oldSessionId, String newSessionId); @@ -65,7 +65,7 @@ public abstract class AbstractSessionRenewTest int scavengePeriod = 3; int inspectPeriod = 1; int idlePassivatePeriod = -1; - _server = createServer(0, maxInactive, scavengePeriod, inspectPeriod, idlePassivatePeriod); + _server = createServer(0, maxInactive, scavengePeriod, idlePassivatePeriod); WebAppContext context = _server.addWebAppContext(".", contextPath); context.setParentLoaderPriority(true); context.addServlet(TestServlet.class, servletMapping); diff --git a/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractSessionValueSavingTest.java b/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractSessionValueSavingTest.java index 7070e9c49ad..dcead37a6e8 100644 --- a/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractSessionValueSavingTest.java +++ b/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractSessionValueSavingTest.java @@ -41,7 +41,7 @@ import org.junit.Test; */ public abstract class AbstractSessionValueSavingTest { - public abstract AbstractTestServer createServer(int port, int max, int scavenge, int inspectPeriod, int idlePassivatePeriod); + public abstract AbstractTestServer createServer(int port, int max, int scavenge, int idlePassivatePeriod); @Test public void testSessionValueSaving() throws Exception @@ -52,7 +52,7 @@ public abstract class AbstractSessionValueSavingTest int scavengePeriod = 20000; int inspectPeriod = 5; int idlePassivatePeriod = -1; - AbstractTestServer server1 = createServer(0, maxInactivePeriod, scavengePeriod, inspectPeriod, idlePassivatePeriod); + AbstractTestServer server1 = createServer(0, maxInactivePeriod, scavengePeriod, idlePassivatePeriod); server1.addContext(contextPath).addServlet(TestServlet.class, servletMapping); try diff --git a/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractTestServer.java b/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractTestServer.java index 25734839d18..174023ebc77 100644 --- a/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractTestServer.java +++ b/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractTestServer.java @@ -35,7 +35,7 @@ import org.eclipse.jetty.webapp.WebAppContext; public abstract class AbstractTestServer { public static int DEFAULT_MAX_INACTIVE = 30; - public static int DEFAULT_INSPECTION_SEC = 2; + public static int DEFAULT_SCAVENGE_SEC = 10; public static int DEFAULT_IDLE_PASSIVATE_SEC = 2; @@ -43,12 +43,11 @@ public abstract class AbstractTestServer protected final Server _server; protected final int _maxInactivePeriod; - protected final int _inspectionPeriod; protected final int _idlePassivatePeriod; protected final int _scavengePeriod; protected final ContextHandlerCollection _contexts; protected SessionIdManager _sessionIdManager; - private PeriodicSessionInspector _inspector; + private HouseKeeper _housekeeper; protected Object _config; @@ -73,29 +72,28 @@ public abstract class AbstractTestServer public AbstractTestServer(int port) { - this(port, DEFAULT_MAX_INACTIVE, DEFAULT_SCAVENGE_SEC, DEFAULT_INSPECTION_SEC, DEFAULT_IDLE_PASSIVATE_SEC); + this(port, DEFAULT_MAX_INACTIVE, DEFAULT_SCAVENGE_SEC, DEFAULT_IDLE_PASSIVATE_SEC); } - public AbstractTestServer(int port, int maxInactivePeriod, int scavengePeriod, int inspectionPeriod, int idlePassivatePeriod) + public AbstractTestServer(int port, int maxInactivePeriod, int scavengePeriod, int idlePassivatePeriod) { - this (port, maxInactivePeriod, scavengePeriod, inspectionPeriod, idlePassivatePeriod, null); + this (port, maxInactivePeriod, scavengePeriod, idlePassivatePeriod, null); } - public AbstractTestServer(int port, int maxInactivePeriod, int scavengePeriod, int inspectionPeriod, int idlePassivatePeriod, Object cfg) + public AbstractTestServer(int port, int maxInactivePeriod, int scavengePeriod, int idlePassivatePeriod, Object cfg) { _server = new Server(port); _maxInactivePeriod = maxInactivePeriod; _scavengePeriod = scavengePeriod; - _inspectionPeriod = inspectionPeriod; _idlePassivatePeriod = idlePassivatePeriod; _contexts = new ContextHandlerCollection(); _config = cfg; _sessionIdManager = newSessionIdManager(); _server.setSessionIdManager(_sessionIdManager); ((DefaultSessionIdManager) _sessionIdManager).setServer(_server); - _inspector = new PeriodicSessionInspector(); - _inspector.setIntervalSec(_inspectionPeriod); - ((DefaultSessionIdManager)_sessionIdManager).setSessionInspector(_inspector); + _housekeeper = new HouseKeeper(); + _housekeeper.setIntervalSec(_scavengePeriod); + ((DefaultSessionIdManager)_sessionIdManager).setSessionInspector(_housekeeper); } @@ -122,9 +120,9 @@ public abstract class AbstractTestServer _server.start(); } - public PeriodicSessionInspector getInspector() + public HouseKeeper getInspector() { - return _inspector; + return _housekeeper; } public int getPort() @@ -140,7 +138,6 @@ public abstract class AbstractTestServer sessionManager.setSessionIdManager(_sessionIdManager); sessionManager.setMaxInactiveInterval(_maxInactivePeriod); sessionManager.getSessionStore().setIdlePassivationTimeoutSec(_idlePassivatePeriod); - sessionManager.getSessionStore().setExpiryTimeoutSec (_scavengePeriod); SessionHandler sessionHandler = newSessionHandler(sessionManager); sessionManager.setSessionHandler(sessionHandler); context.setSessionHandler(sessionHandler); @@ -167,7 +164,6 @@ public abstract class AbstractTestServer sessionManager.setMaxInactiveInterval(_maxInactivePeriod); sessionManager.getSessionStore().setIdlePassivationTimeoutSec(_idlePassivatePeriod); - sessionManager.getSessionStore().setExpiryTimeoutSec (_scavengePeriod); SessionHandler sessionHandler = newSessionHandler(sessionManager); sessionManager.setSessionHandler(sessionHandler);