From 0b7811732ceb0b123c6e1fbe439d3ae3a18b67d5 Mon Sep 17 00:00:00 2001 From: Michael Cameron Date: Mon, 15 Dec 2014 09:35:40 -0600 Subject: [PATCH 1/4] Upgrade to tomcat8 --- build.gradle | 4 ++-- .../tomcat/redissessions/RedisSessionManager.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index 2bd0db6a..8f275b38 100644 --- a/build.gradle +++ b/build.gradle @@ -3,7 +3,7 @@ apply plugin: 'maven' apply plugin: 'signing' group = 'com.orangefunction' -version = '2.0.0' +version = '2.0.0-tomcat8' repositories { mavenCentral() @@ -15,7 +15,7 @@ compileJava { } dependencies { - compile group: 'org.apache.tomcat', name: 'tomcat-catalina', version: '7.0.27' + compile group: 'org.apache.tomcat', name: 'tomcat-catalina', version: '8.0.15' compile group: 'redis.clients', name: 'jedis', version: '2.5.2' compile group: 'org.apache.commons', name: 'commons-pool2', version: '2.2' //compile group: 'commons-codec', name: 'commons-codec', version: '1.9' diff --git a/src/main/java/com/orangefunction/tomcat/redissessions/RedisSessionManager.java b/src/main/java/com/orangefunction/tomcat/redissessions/RedisSessionManager.java index 2ffbe67d..fee06f56 100644 --- a/src/main/java/com/orangefunction/tomcat/redissessions/RedisSessionManager.java +++ b/src/main/java/com/orangefunction/tomcat/redissessions/RedisSessionManager.java @@ -712,8 +712,8 @@ private void initializeSerializer() throws ClassNotFoundException, IllegalAccess Loader loader = null; - if (getContainer() != null) { - loader = getContainer().getLoader(); + if (getContext() != null) { + loader = getContext().getLoader(); } ClassLoader classLoader = null; From c893c39ff652a3a9390773366f84cc3262d05a54 Mon Sep 17 00:00:00 2001 From: Michael Cameron Date: Wed, 18 Feb 2015 16:41:26 -0600 Subject: [PATCH 2/4] Do not wipe out current session when calling findSession with other session IDs --- .../tomcat/redissessions/RedisSessionManager.java | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/main/java/com/orangefunction/tomcat/redissessions/RedisSessionManager.java b/src/main/java/com/orangefunction/tomcat/redissessions/RedisSessionManager.java index 12af7308..4efef370 100644 --- a/src/main/java/com/orangefunction/tomcat/redissessions/RedisSessionManager.java +++ b/src/main/java/com/orangefunction/tomcat/redissessions/RedisSessionManager.java @@ -422,10 +422,7 @@ public Session findSession(String id) throws IOException { RedisSession session = null; if (null == id) { - currentSessionIsPersisted.set(false); - currentSession.set(null); - currentSessionSerializationMetadata.set(null); - currentSessionId.set(null); + return null; } else if (id.equals(currentSessionId.get())) { session = currentSession.get(); } else { @@ -433,15 +430,6 @@ public Session findSession(String id) throws IOException { if (data != null) { DeserializedSessionContainer container = sessionFromSerializedData(id, data); session = container.session; - currentSession.set(session); - currentSessionSerializationMetadata.set(container.metadata); - currentSessionIsPersisted.set(true); - currentSessionId.set(id); - } else { - currentSessionIsPersisted.set(false); - currentSession.set(null); - currentSessionSerializationMetadata.set(null); - currentSessionId.set(null); } } From a9b74fc3abdf5516aa7d15b6eb05c659d730d576 Mon Sep 17 00:00:00 2001 From: Michael Cameron Date: Wed, 18 Feb 2015 17:04:54 -0600 Subject: [PATCH 3/4] Bump version number --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 8f275b38..2b02d05c 100644 --- a/build.gradle +++ b/build.gradle @@ -3,7 +3,7 @@ apply plugin: 'maven' apply plugin: 'signing' group = 'com.orangefunction' -version = '2.0.0-tomcat8' +version = '2.0.3-tomcat8-gravie' repositories { mavenCentral() From e86c8c00d45f2c72ca74b806211f5ff558e42b8a Mon Sep 17 00:00:00 2001 From: Michael Cameron Date: Thu, 19 Feb 2015 10:13:00 -0600 Subject: [PATCH 4/4] Do not wipe out current session when calling findSession and no session is found --- .../tomcat/redissessions/RedisSessionManager.java | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/main/java/com/orangefunction/tomcat/redissessions/RedisSessionManager.java b/src/main/java/com/orangefunction/tomcat/redissessions/RedisSessionManager.java index 12af7308..0e89e541 100644 --- a/src/main/java/com/orangefunction/tomcat/redissessions/RedisSessionManager.java +++ b/src/main/java/com/orangefunction/tomcat/redissessions/RedisSessionManager.java @@ -422,10 +422,7 @@ public Session findSession(String id) throws IOException { RedisSession session = null; if (null == id) { - currentSessionIsPersisted.set(false); - currentSession.set(null); - currentSessionSerializationMetadata.set(null); - currentSessionId.set(null); + return null; } else if (id.equals(currentSessionId.get())) { session = currentSession.get(); } else { @@ -437,11 +434,6 @@ public Session findSession(String id) throws IOException { currentSessionSerializationMetadata.set(container.metadata); currentSessionIsPersisted.set(true); currentSessionId.set(id); - } else { - currentSessionIsPersisted.set(false); - currentSession.set(null); - currentSessionSerializationMetadata.set(null); - currentSessionId.set(null); } }