add new module for hazelcast session manager

Signed-off-by: olivier lamy <olamy@webtide.com>
This commit is contained in:
olivier lamy 2017-06-08 22:00:24 +10:00 committed by Joakim Erdfelt
parent 652cc327d7
commit 0bee599d29
7 changed files with 176 additions and 121 deletions

View File

@ -869,7 +869,22 @@
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-alpn-server</artifactId>
<artifactId>jetty-infinispan</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-hazelcast</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.gcloud</groupId>
<artifactId>jetty-gcloud-session-manager</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.gcloud</groupId>
<artifactId>jetty-gcloud-memcached-session-manager</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>

View File

@ -1,68 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-project</artifactId>
<version>9.4.7-SNAPSHOT</version>
<version>9.3.21-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>jetty-hazelcast</artifactId>
<name>Jetty :: Hazelcast Session Manager</name>
<name>Jetty :: Hazelcast Session Managers</name>
<url>http://www.eclipse.org/jetty</url>
<properties>
<hazelcast.version>3.8.2</hazelcast.version>
<bundle-symbolic-name>${project.groupId}.hazelcast</bundle-symbolic-name>
<hazelcast.sessionManager.version>1.0.2</hazelcast.sessionManager.version>
<hazelcast.version>3.8.2</hazelcast.version>
</properties>
<dependencies>
<dependency>
<groupId>com.hazelcast</groupId>
<artifactId>hazelcast</artifactId>
<version>${hazelcast.version}</version>
<type>test-jar</type>
</dependency>
<dependency>
<groupId>com.hazelcast</groupId>
<artifactId>hazelcast-client</artifactId>
<version>${hazelcast.version}</version>
</dependency>
<dependency>
<groupId>com.hazelcast</groupId>
<artifactId>hazelcast</artifactId>
<version>${hazelcast.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-webapp</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.websocket</groupId>
<artifactId>websocket-servlet</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.websocket</groupId>
<artifactId>websocket-server</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.toolchain</groupId>
<artifactId>jetty-test-helper</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
@ -82,7 +33,32 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
</archive>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>com.hazelcast</groupId>
<artifactId>hazelcast-jetty9-sessionmanager</artifactId>
<version>${hazelcast.sessionManager.version}</version>
</dependency>
<dependency>
<groupId>com.hazelcast</groupId>
<artifactId>hazelcast-all</artifactId>
<version>${hazelcast.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</project>

View File

@ -3,19 +3,17 @@
<Configure id="Server" class="org.eclipse.jetty.server.Server">
<!-- ===================================================================== -->
<!-- Configure a factory for HazelcastSessionDataStore using -->
<!-- an embedded Hazelcast Instance -->
<!-- Configure a SessionIdManager with the Hazelcast IdManager. -->
<!-- ===================================================================== -->
<Call name="addBean">
<Set name="sessionIdManager">
<New id="hazelcastIdMgr" class="com.hazelcast.session.HazelcastSessionIdManager">
<Arg>
<New id="sessionDataStoreFactory" class="org.eclipse.jetty.hazelcast.session.HazelcastSessionDataStoreFactory">
<Set name="mapName"><Property name="jetty.session.hazelcast.mapName" default="jetty-distributed-session-map" /></Set>
<Set name="hazelcastInstanceName"><Property name="jetty.session.hazelcast.hazelcastInstanceName" default="JETTY_DISTRIBUTED_SESSION_INSTANCE" /></Set>
<Set name="gracePeriodSec"><Property name="jetty.session.gracePeriod.seconds" default="3600" /></Set>
<Set name="savePeriodSec"><Property name="jetty.session.savePeriod.seconds" default="0" /></Set>
</New>
<Ref refid="Server"/>
</Arg>
</Call>
<Set name="configLocation"><Property name="jetty.session.hazelcast.configurationLocation"/></Set>
<Set name="clientOnly">false</Set>
</New>
</Set>
</Configure>

View File

@ -4,18 +4,16 @@
<Configure id="Server" class="org.eclipse.jetty.server.Server">
<!-- ===================================================================== -->
<!-- Configure a factory for HazelcastSessionDataStore using -->
<!-- an embedded Hazelcast Instance -->
<!-- Configure a SessionIdManager with the Hazelcast IdManager. -->
<!-- ===================================================================== -->
<Call name="addBean">
<Set name="sessionIdManager">
<New id="hazelcastIdMgr" class="com.hazelcast.session.HazelcastSessionIdManager">
<Arg>
<New id="sessionDataStoreFactory" class="org.eclipse.jetty.hazelcast.session.HazelcastSessionDataStoreFactory">
<Set name="mapName"><Property name="jetty.session.hazelcast.mapName" default="jetty-distributed-session-map" /></Set>
<Set name="hazelcastInstanceName"><Property name="jetty.session.hazelcast.hazelcastInstanceName" default="JETTY_DISTRIBUTED_SESSION_INSTANCE" /></Set>
<Set name="gracePeriodSec"><Property name="jetty.session.gracePeriod.seconds" default="3600" /></Set>
<Set name="savePeriodSec"><Property name="jetty.session.savePeriod.seconds" default="0" /></Set>
<Set name="onlyClient"><Property name="jetty.session.hazelcast.onlyClient" default="true" /></Set>
</New>
<Ref refid="Server"/>
</Arg>
</Call>
<Set name="configLocation"><Property name="jetty.session.hazelcast.configurationLocation"/></Set>
<Set name="clientOnly">true</Set>
</New>
</Set>
</Configure>

View File

@ -1,23 +1,20 @@
[description]
Enables session data store in an embedded Hazelcast Map
[tags]
session
[provides]
session-store
#
# Jetty Hazelcast module
#
[depend]
sessions
annotations
webapp
[files]
maven://com.hazelcast/hazelcast/3.8.2|lib/hazelcast/hazelcast-3.8.2.jar
maven://com.hazelcast/hazelcast-all/3.8.2|lib/hazelcast/hazelcast-all-3.8.2.jar
maven://com.hazelcast/hazelcast-jetty9-sessionmanager/1.0.2|lib/hazelcast/hazelcast-jetty9-sessionmanager-1.0.2.jar
maven://org.eclipse.jetty/jetty-nosql/${jetty.version}|lib/hazelcast/jetty-nosql-${jetty.version}.jar
[xml]
etc/sessions/hazelcast/default.xml
[lib]
lib/jetty-hazelcast-${jetty.version}.jar
lib/hazelcast/*.jar
[license]
@ -25,10 +22,5 @@ Hazelcast is an open source project hosted on Github and released under the Apac
https://hazelcast.org/
http://www.apache.org/licenses/LICENSE-2.0.html
[ini-template]
jetty.session.hazelcast.mapName=jetty-distributed-session-map
jetty.session.hazelcast.hazelcastInstanceName=JETTY_DISTRIBUTED_SESSION_INSTANCE
#jetty.session.hazelcast.configurationLocation=
jetty.session.gracePeriod.seconds=3600
jetty.session.savePeriod.seconds=0

View File

@ -1,36 +1,26 @@
[description]
Enables session data store in a remote Hazelcast Map
[tags]
session
[provides]
session-store
#
# Jetty Hazelcast module
#
[depend]
sessions
annotations
webapp
[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
maven://com.hazelcast/hazelcast-all/3.8.2|lib/hazelcast/hazelcast-all-3.8.2.jar
maven://com.hazelcast/hazelcast-jetty9-sessionmanager/1.0.2|lib/hazelcast/hazelcast-jetty9-sessionmanager-1.0.2.jar
maven://org.eclipse.jetty/jetty-nosql/${jetty.version}|lib/hazelcast/jetty-nosql-${jetty.version}.jar
[xml]
etc/sessions/hazelcast/remote.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/
https://hazelcast.org/
http://www.apache.org/licenses/LICENSE-2.0.html
[ini-template]
jetty.session.hazelcast.mapName=jetty-distributed-session-map
jetty.session.hazelcast.hazelcastInstanceName=JETTY_DISTRIBUTED_SESSION_INSTANCE
jetty.session.hazelcast.onlyClient=true
#jetty.session.hazelcast.configurationLocation=
jetty.session.gracePeriod.seconds=3600
jetty.session.savePeriod.seconds=0

86
pom.xml
View File

@ -861,6 +861,92 @@
</pluginManagement>
</build>
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jxr-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<maxmemory>512m</maxmemory>
<docfilessubdirs>true</docfilessubdirs>
<detectLinks>true</detectLinks>
<detectJavaApiLink>true</detectJavaApiLink>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<configuration>
<targetJdk>1.7</targetJdk>
<rulesets>
<ruleset>jetty/pmd_ruleset.xml</ruleset>
</rulesets>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
</plugin>
</plugins>
</reporting>
<modules>
<module>jetty-ant</module>
<module>jetty-util</module>
<module>jetty-jmx</module>
<module>jetty-io</module>
<module>jetty-http</module>
<module>jetty-http2</module>
<module>jetty-continuation</module>
<module>jetty-server</module>
<module>jetty-xml</module>
<module>jetty-security</module>
<module>jetty-servlet</module>
<module>jetty-webapp</module>
<module>jetty-fcgi</module>
<module>jetty-websocket</module>
<module>jetty-servlets</module>
<module>jetty-util-ajax</module>
<module>apache-jsp</module>
<module>apache-jstl</module>
<module>jetty-maven-plugin</module>
<module>jetty-jspc-maven-plugin</module>
<module>jetty-deploy</module>
<module>jetty-start</module>
<module>jetty-plus</module>
<module>jetty-annotations</module>
<module>jetty-jndi</module>
<module>jetty-jaas</module>
<module>jetty-cdi</module>
<module>jetty-spring</module>
<module>jetty-client</module>
<module>jetty-proxy</module>
<module>jetty-jaspi</module>
<module>jetty-rewrite</module>
<module>jetty-nosql</module>
<module>jetty-infinispan</module>
<module>jetty-hazelcast</module>
<module>jetty-gcloud</module>
<module>tests</module>
<module>examples</module>
<module>jetty-quickstart</module>
<module>jetty-distribution</module>
<module>jetty-runner</module>
<module>jetty-monitor</module>
<module>jetty-http-spi</module>
<module>jetty-osgi</module>
<module>jetty-alpn</module>
<module>jetty-bom</module>
<module>jetty-documentation</module>
<!-- modules that need fixed and added back, or simply dropped and not maintained -->
<!--<module>jetty-rhttp</module>-->
<!--<module>jetty-overlay-deployer</module>-->
</modules>
<dependencyManagement>
<dependencies>
<dependency>