Repository: incubator-geode Updated Branches: refs/heads/develop 9389c6fec -> a6e9569f5
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a6e9569f/extensions/geode-modules/src/main/java/com/gemstone/gemfire/modules/session/catalina/Tomcat6DeltaSessionManager.java ---------------------------------------------------------------------- diff --git a/extensions/geode-modules/src/main/java/com/gemstone/gemfire/modules/session/catalina/Tomcat6DeltaSessionManager.java b/extensions/geode-modules/src/main/java/com/gemstone/gemfire/modules/session/catalina/Tomcat6DeltaSessionManager.java index d5b5991..c89b990 100644 --- a/extensions/geode-modules/src/main/java/com/gemstone/gemfire/modules/session/catalina/Tomcat6DeltaSessionManager.java +++ b/extensions/geode-modules/src/main/java/com/gemstone/gemfire/modules/session/catalina/Tomcat6DeltaSessionManager.java @@ -17,10 +17,17 @@ package com.gemstone.gemfire.modules.session.catalina; import org.apache.catalina.LifecycleException; +import org.apache.catalina.LifecycleListener; +import org.apache.catalina.util.LifecycleSupport; public class Tomcat6DeltaSessionManager extends DeltaSessionManager { /** + * The <code>LifecycleSupport</code> for this component. + */ + protected LifecycleSupport lifecycle = new LifecycleSupport(this); + + /** * Prepare for the beginning of active use of the public methods of this component. This method should be called * after <code>configure()</code>, and before any of the public methods of the component are utilized. * @@ -95,4 +102,33 @@ public class Tomcat6DeltaSessionManager extends DeltaSessionManager { unregisterCommitSessionValve(); } } + + /** + * Add a lifecycle event listener to this component. + * + * @param listener The listener to add + */ + @Override + public void addLifecycleListener(LifecycleListener listener) { + this.lifecycle.addLifecycleListener(listener); + } + + /** + * Get the lifecycle listeners associated with this lifecycle. If this Lifecycle has no listeners registered, a + * zero-length array is returned. + */ + @Override + public LifecycleListener[] findLifecycleListeners() { + return this.lifecycle.findLifecycleListeners(); + } + + /** + * Remove a lifecycle event listener from this component. + * + * @param listener The listener to remove + */ + @Override + public void removeLifecycleListener(LifecycleListener listener) { + this.lifecycle.removeLifecycleListener(listener); + } } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a6e9569f/extensions/geode-modules/src/main/java/com/gemstone/gemfire/modules/session/catalina/callback/SessionExpirationCacheListener.java ---------------------------------------------------------------------- diff --git a/extensions/geode-modules/src/main/java/com/gemstone/gemfire/modules/session/catalina/callback/SessionExpirationCacheListener.java b/extensions/geode-modules/src/main/java/com/gemstone/gemfire/modules/session/catalina/callback/SessionExpirationCacheListener.java index dff6d58..5893c95 100644 --- a/extensions/geode-modules/src/main/java/com/gemstone/gemfire/modules/session/catalina/callback/SessionExpirationCacheListener.java +++ b/extensions/geode-modules/src/main/java/com/gemstone/gemfire/modules/session/catalina/callback/SessionExpirationCacheListener.java @@ -27,6 +27,8 @@ import com.gemstone.gemfire.modules.util.ContextMapper; import javax.servlet.http.HttpSession; import java.util.Properties; +import org.apache.catalina.session.ManagerBase; + public class SessionExpirationCacheListener extends CacheListenerAdapter<String, HttpSession> implements Declarable { public void afterDestroy(EntryEvent<String, HttpSession> event) { @@ -47,7 +49,7 @@ public class SessionExpirationCacheListener extends CacheListenerAdapter<String, Object callback = event.getCallbackArgument(); if (callback != null && callback instanceof DeltaSession) { session = (DeltaSession) callback; - DeltaSessionManager m = ContextMapper.getContext(session.getContextName()); + ManagerBase m = ContextMapper.getContext(session.getContextName()); if (m != null) { session.setOwner(m); } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a6e9569f/extensions/geode-modules/src/main/java/com/gemstone/gemfire/modules/session/catalina/internal/DeltaSessionAttributeEvent.java ---------------------------------------------------------------------- diff --git a/extensions/geode-modules/src/main/java/com/gemstone/gemfire/modules/session/catalina/internal/DeltaSessionAttributeEvent.java b/extensions/geode-modules/src/main/java/com/gemstone/gemfire/modules/session/catalina/internal/DeltaSessionAttributeEvent.java index 90b6f28..c930d6f 100644 --- a/extensions/geode-modules/src/main/java/com/gemstone/gemfire/modules/session/catalina/internal/DeltaSessionAttributeEvent.java +++ b/extensions/geode-modules/src/main/java/com/gemstone/gemfire/modules/session/catalina/internal/DeltaSessionAttributeEvent.java @@ -18,8 +18,9 @@ package com.gemstone.gemfire.modules.session.catalina.internal; import com.gemstone.gemfire.DataSerializable; import com.gemstone.gemfire.modules.session.catalina.DeltaSession; +import com.gemstone.gemfire.modules.session.catalina.DeltaSessionInterface; public interface DeltaSessionAttributeEvent extends DataSerializable { - public void apply(DeltaSession session); + public void apply(DeltaSessionInterface session); } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a6e9569f/extensions/geode-modules/src/main/java/com/gemstone/gemfire/modules/session/catalina/internal/DeltaSessionAttributeEventBatch.java ---------------------------------------------------------------------- diff --git a/extensions/geode-modules/src/main/java/com/gemstone/gemfire/modules/session/catalina/internal/DeltaSessionAttributeEventBatch.java b/extensions/geode-modules/src/main/java/com/gemstone/gemfire/modules/session/catalina/internal/DeltaSessionAttributeEventBatch.java index 47df071..8e4c0c3 100644 --- a/extensions/geode-modules/src/main/java/com/gemstone/gemfire/modules/session/catalina/internal/DeltaSessionAttributeEventBatch.java +++ b/extensions/geode-modules/src/main/java/com/gemstone/gemfire/modules/session/catalina/internal/DeltaSessionAttributeEventBatch.java @@ -21,6 +21,7 @@ import com.gemstone.gemfire.cache.Cache; import com.gemstone.gemfire.cache.Region; import com.gemstone.gemfire.modules.gatewaydelta.AbstractGatewayDeltaEvent; import com.gemstone.gemfire.modules.session.catalina.DeltaSession; +import com.gemstone.gemfire.modules.session.catalina.DeltaSessionInterface; import java.io.DataInput; import java.io.DataOutput; @@ -47,8 +48,8 @@ public class DeltaSessionAttributeEventBatch extends AbstractGatewayDeltaEvent { } public void apply(Cache cache) { - Region<String, DeltaSession> region = getRegion(cache); - DeltaSession session = region.get(this.key); + Region<String, DeltaSessionInterface> region = getRegion(cache); + DeltaSessionInterface session = region.get(this.key); if (session == null) { StringBuilder builder = new StringBuilder(); builder.append("Session ").append(this.key).append(" was not found while attempting to apply ").append(this); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a6e9569f/extensions/geode-modules/src/main/java/com/gemstone/gemfire/modules/session/catalina/internal/DeltaSessionDestroyAttributeEvent.java ---------------------------------------------------------------------- diff --git a/extensions/geode-modules/src/main/java/com/gemstone/gemfire/modules/session/catalina/internal/DeltaSessionDestroyAttributeEvent.java b/extensions/geode-modules/src/main/java/com/gemstone/gemfire/modules/session/catalina/internal/DeltaSessionDestroyAttributeEvent.java index 989474f..dd96f49 100644 --- a/extensions/geode-modules/src/main/java/com/gemstone/gemfire/modules/session/catalina/internal/DeltaSessionDestroyAttributeEvent.java +++ b/extensions/geode-modules/src/main/java/com/gemstone/gemfire/modules/session/catalina/internal/DeltaSessionDestroyAttributeEvent.java @@ -20,6 +20,7 @@ import com.gemstone.gemfire.DataSerializable; import com.gemstone.gemfire.DataSerializer; import com.gemstone.gemfire.Instantiator; import com.gemstone.gemfire.modules.session.catalina.DeltaSession; +import com.gemstone.gemfire.modules.session.catalina.DeltaSessionInterface; import java.io.DataInput; import java.io.DataOutput; @@ -42,7 +43,7 @@ public class DeltaSessionDestroyAttributeEvent implements DeltaSessionAttributeE return this.attributeName; } - public void apply(DeltaSession session) { + public void apply(DeltaSessionInterface session) { session.localDestroyAttribute(this.attributeName); } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a6e9569f/extensions/geode-modules/src/main/java/com/gemstone/gemfire/modules/session/catalina/internal/DeltaSessionUpdateAttributeEvent.java ---------------------------------------------------------------------- diff --git a/extensions/geode-modules/src/main/java/com/gemstone/gemfire/modules/session/catalina/internal/DeltaSessionUpdateAttributeEvent.java b/extensions/geode-modules/src/main/java/com/gemstone/gemfire/modules/session/catalina/internal/DeltaSessionUpdateAttributeEvent.java index 6678e55..7b47280 100644 --- a/extensions/geode-modules/src/main/java/com/gemstone/gemfire/modules/session/catalina/internal/DeltaSessionUpdateAttributeEvent.java +++ b/extensions/geode-modules/src/main/java/com/gemstone/gemfire/modules/session/catalina/internal/DeltaSessionUpdateAttributeEvent.java @@ -20,6 +20,7 @@ import com.gemstone.gemfire.DataSerializable; import com.gemstone.gemfire.DataSerializer; import com.gemstone.gemfire.Instantiator; import com.gemstone.gemfire.modules.session.catalina.DeltaSession; +import com.gemstone.gemfire.modules.session.catalina.DeltaSessionInterface; import java.io.DataInput; import java.io.DataOutput; @@ -48,7 +49,7 @@ public class DeltaSessionUpdateAttributeEvent implements DeltaSessionAttributeEv return this.attributeValue; } - public void apply(DeltaSession session) { + public void apply(DeltaSessionInterface session) { session.localUpdateAttribute(this.attributeName, this.attributeValue); } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a6e9569f/extensions/geode-modules/src/main/java/com/gemstone/gemfire/modules/util/ContextMapper.java ---------------------------------------------------------------------- diff --git a/extensions/geode-modules/src/main/java/com/gemstone/gemfire/modules/util/ContextMapper.java b/extensions/geode-modules/src/main/java/com/gemstone/gemfire/modules/util/ContextMapper.java index 3b7b2de..e539d89 100644 --- a/extensions/geode-modules/src/main/java/com/gemstone/gemfire/modules/util/ContextMapper.java +++ b/extensions/geode-modules/src/main/java/com/gemstone/gemfire/modules/util/ContextMapper.java @@ -21,6 +21,8 @@ import com.gemstone.gemfire.modules.session.catalina.DeltaSessionManager; import java.util.HashMap; import java.util.Map; +import org.apache.catalina.session.ManagerBase; + /** * This basic singleton class maps context paths to manager instances. * <p> @@ -33,21 +35,21 @@ import java.util.Map; public class ContextMapper { - private static Map<String, DeltaSessionManager> managers = new HashMap<String, DeltaSessionManager>(); + private static Map<String, ManagerBase> managers = new HashMap<String, ManagerBase>(); private ContextMapper() { // This is a singleton } - public static void addContext(String path, DeltaSessionManager manager) { + public static void addContext(String path, ManagerBase manager) { managers.put(path, manager); } - public static DeltaSessionManager getContext(String path) { + public static ManagerBase getContext(String path) { return managers.get(path); } - public static DeltaSessionManager removeContext(String path) { + public static ManagerBase removeContext(String path) { return managers.remove(path); } } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a6e9569f/gradle/dependency-versions.properties ---------------------------------------------------------------------- diff --git a/gradle/dependency-versions.properties b/gradle/dependency-versions.properties index aafacef..a19520c 100644 --- a/gradle/dependency-versions.properties +++ b/gradle/dependency-versions.properties @@ -105,3 +105,4 @@ system-rules.version = 1.16.0 tempus-fugit.version = 1.1 tomcat6.version = 6.0.37 tomcat7.version = 7.0.30 +tomcat8.version = 8.5.4 http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a6e9569f/settings.gradle ---------------------------------------------------------------------- diff --git a/settings.gradle b/settings.gradle index ca34692..95c15f2 100644 --- a/settings.gradle +++ b/settings.gradle @@ -30,6 +30,7 @@ include 'geode-wan' include 'geode-cq' include 'extensions/geode-modules' include 'extensions/geode-modules-tomcat7' +include 'extensions/geode-modules-tomcat8' include 'extensions/geode-modules-hibernate' include 'extensions/geode-modules-session-internal' include 'extensions/geode-modules-session'