From 935d58519478afeb989979bfecc1545ab69b4aa3 Mon Sep 17 00:00:00 2001 From: olivier lamy Date: Mon, 29 May 2017 21:42:54 +1000 Subject: [PATCH] Hazelcast session management #1571 fix modules configuration Signed-off-by: olivier lamy --- jetty-distribution/pom.xml | 17 +++- jetty-hazelcast/pom.xml | 87 ++----------------- jetty-hazelcast/src/main/assembly/config.xml | 27 ------ .../etc/sessions/hazelcast/session-store.xml | 18 ---- .../modules/session-store-hazelcast.mod | 36 -------- .../config/etc/sessions/hazelcast/default.xml | 33 +++++++ .../config/etc/sessions/hazelcast/remote.xml | 33 +++++++ .../session-store-hazelcast-embedded.mod | 34 ++++++++ .../session-store-hazelcast-remote.mod | 34 ++++++++ .../HazelcastSessionDataStoreFactory.java | 1 - 10 files changed, 155 insertions(+), 165 deletions(-) delete mode 100644 jetty-hazelcast/src/main/assembly/config.xml delete mode 100644 jetty-hazelcast/src/main/config-template/etc/sessions/hazelcast/session-store.xml delete mode 100644 jetty-hazelcast/src/main/config-template/modules/session-store-hazelcast.mod create mode 100644 jetty-hazelcast/src/main/config/etc/sessions/hazelcast/default.xml create mode 100644 jetty-hazelcast/src/main/config/etc/sessions/hazelcast/remote.xml create mode 100644 jetty-hazelcast/src/main/config/modules/session-store-hazelcast-embedded.mod create mode 100644 jetty-hazelcast/src/main/config/modules/session-store-hazelcast-remote.mod diff --git a/jetty-distribution/pom.xml b/jetty-distribution/pom.xml index 7347ef67901..3290f3113bb 100644 --- a/jetty-distribution/pom.xml +++ b/jetty-distribution/pom.xml @@ -43,7 +43,22 @@ maven-antrun-plugin - generate-resources + populate distribution from home + process-resources + + run + + + + + + + + + + + set jetty.sh + process-resources run diff --git a/jetty-hazelcast/pom.xml b/jetty-hazelcast/pom.xml index d5062f6d23b..bc24e821994 100644 --- a/jetty-hazelcast/pom.xml +++ b/jetty-hazelcast/pom.xml @@ -2,8 +2,8 @@ - jetty-project org.eclipse.jetty + jetty-project 9.4.6-SNAPSHOT @@ -13,7 +13,7 @@ 3.8.2 - ${project.groupId}.session + ${project.groupId}.hazelcast @@ -65,83 +65,6 @@ - - org.apache.felix - maven-bundle-plugin - true - - - - manifest - - - - - org.eclipse.jetty.hazelcast.session.*;version="${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}"; - - - - - - - - org.apache.maven.plugins - maven-dependency-plugin - - - build-deps-file - generate-resources - - list - - - false - ${project.build.directory}/deps.txt - true - org.eclipse.jetty - true - runtime - - - - - - org.apache.maven.plugins - maven-antrun-plugin - - - process-deps - process-resources - - run - - - - - - - - - process-mod - process-resources - - run - - - - - - - - - - - - - org.apache.maven.plugins maven-assembly-plugin @@ -152,9 +75,9 @@ single - - src/main/assembly/config.xml - + + config + diff --git a/jetty-hazelcast/src/main/assembly/config.xml b/jetty-hazelcast/src/main/assembly/config.xml deleted file mode 100644 index 45e740841f1..00000000000 --- a/jetty-hazelcast/src/main/assembly/config.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - config - false - - jar - - - - src/main/config-template - - - ** - - - **/session-store-hazelcast.mod - - - - target - modules - - session-store-hazelcast.mod - - - - diff --git a/jetty-hazelcast/src/main/config-template/etc/sessions/hazelcast/session-store.xml b/jetty-hazelcast/src/main/config-template/etc/sessions/hazelcast/session-store.xml deleted file mode 100644 index ecd6efb1ea0..00000000000 --- a/jetty-hazelcast/src/main/config-template/etc/sessions/hazelcast/session-store.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/jetty-hazelcast/src/main/config-template/modules/session-store-hazelcast.mod b/jetty-hazelcast/src/main/config-template/modules/session-store-hazelcast.mod deleted file mode 100644 index 5b70060bf23..00000000000 --- a/jetty-hazelcast/src/main/config-template/modules/session-store-hazelcast.mod +++ /dev/null @@ -1,36 +0,0 @@ -[description] -Enables Hazelcast session management. - -[tags] -session -hazelcast - -[provides] -session-store - -[depends] -annotations -webapp -sessions - -[lib] -lib/hazelcast/*.jar -lib/jetty-hazelcast-session-manager-${jetty.version}.jar - -[xml] -etc/sessions/hazelcast/session-store.xml - -[license] -Hazelcast is an open source project hosted on Github and released under the Apache 2.0 license. -http://hazelcast.org/ -http://www.apache.org/licenses/LICENSE-2.0.html - -[ini] -## Hide the hazelcast libraries from deployed webapps -jetty.webapp.addServerClasses+=,${jetty.base.uri}/lib/hazelcast/ - -[ini-template] - -## Hazelcast Session config -#jetty.session.gracePeriod.seconds=3600 -# FIXME add some configuration diff --git a/jetty-hazelcast/src/main/config/etc/sessions/hazelcast/default.xml b/jetty-hazelcast/src/main/config/etc/sessions/hazelcast/default.xml new file mode 100644 index 00000000000..435b738c8c7 --- /dev/null +++ b/jetty-hazelcast/src/main/config/etc/sessions/hazelcast/default.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/jetty-hazelcast/src/main/config/etc/sessions/hazelcast/remote.xml b/jetty-hazelcast/src/main/config/etc/sessions/hazelcast/remote.xml new file mode 100644 index 00000000000..435b738c8c7 --- /dev/null +++ b/jetty-hazelcast/src/main/config/etc/sessions/hazelcast/remote.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/jetty-hazelcast/src/main/config/modules/session-store-hazelcast-embedded.mod b/jetty-hazelcast/src/main/config/modules/session-store-hazelcast-embedded.mod new file mode 100644 index 00000000000..3d89eabbfc1 --- /dev/null +++ b/jetty-hazelcast/src/main/config/modules/session-store-hazelcast-embedded.mod @@ -0,0 +1,34 @@ +[description] +Enables session data store in an embedded Hazelcast Map + +[tags] +session + +[provides] +session-store + +[depend] +sessions + +[files] +maven://com.hazelcast/hazelcast/3.8.2|lib/hazelcast/hazelcast-3.8.2.jar +maven://com.hazelcast/hazelcast-client/3.8.2|lib/hazelcast/hazelcast-client-3.8.2.jar + +[xml] +etc/sessions/hazelcast/default.xml + +[lib] +lib/jetty-hazelcast-${jetty.version}.jar +lib/hazelcast/*.jar + +[license] +Hazelcast is an open source project hosted on Github and released under the Apache 2.0 license. +https://hazelcast.org/ +http://www.apache.org/licenses/LICENSE-2.0.html + + +[ini-template] +#jetty.session.hazelcast.jettySessionMapName=jetty_sessions +#jetty.session.hazelcast.configurationLocation= +#jetty.session.gracePeriod.seconds=3600 +#jetty.session.savePeriod.seconds=0 \ No newline at end of file diff --git a/jetty-hazelcast/src/main/config/modules/session-store-hazelcast-remote.mod b/jetty-hazelcast/src/main/config/modules/session-store-hazelcast-remote.mod new file mode 100644 index 00000000000..cae1e561882 --- /dev/null +++ b/jetty-hazelcast/src/main/config/modules/session-store-hazelcast-remote.mod @@ -0,0 +1,34 @@ +[description] +Enables session data store in a remote Hazelcast Map + +[tags] +session + +[provides] +session-store + +[depend] +sessions + +[files] +maven://com.hazelcast/hazelcast/3.8.2|lib/hazelcast/hazelcast-3.8.2.jar +maven://com.hazelcast/hazelcast-client/3.8.2|lib/hazelcast/hazelcast-client-3.8.2.jar + +[xml] +etc/sessions/hazelcast/remote.xml + +[lib] +lib/jetty-hazelcast-${jetty.version}.jar +lib/hazelcast/*.jar + +[license] +Hazelcast is an open source project hosted on Github and released under the Apache 2.0 license. + https://hazelcast.org/ +http://www.apache.org/licenses/LICENSE-2.0.html + + +[ini-template] +#jetty.session.hazelcast.jettySessionMapName=jetty_sessions +#jetty.session.hazelcast.onlyClient=true +#jetty.session.gracePeriod.seconds=3600 +#jetty.session.savePeriod.seconds=0 \ No newline at end of file diff --git a/jetty-hazelcast/src/main/java/org/eclipse/jetty/hazelcast/session/HazelcastSessionDataStoreFactory.java b/jetty-hazelcast/src/main/java/org/eclipse/jetty/hazelcast/session/HazelcastSessionDataStoreFactory.java index 874ada29f1f..2dcbbb77a7c 100644 --- a/jetty-hazelcast/src/main/java/org/eclipse/jetty/hazelcast/session/HazelcastSessionDataStoreFactory.java +++ b/jetty-hazelcast/src/main/java/org/eclipse/jetty/hazelcast/session/HazelcastSessionDataStoreFactory.java @@ -27,7 +27,6 @@ import com.hazelcast.config.XmlConfigBuilder; import com.hazelcast.core.Hazelcast; import com.hazelcast.core.HazelcastInstance; import org.eclipse.jetty.server.session.AbstractSessionDataStoreFactory; -import org.eclipse.jetty.server.session.SessionDataMap; import org.eclipse.jetty.server.session.SessionDataStore; import org.eclipse.jetty.server.session.SessionDataStoreFactory; import org.eclipse.jetty.server.session.SessionHandler;