Hazelcast session management #1571

fix modules configuration

Signed-off-by: olivier lamy <olamy@webtide.com>
This commit is contained in:
olivier lamy 2017-05-29 21:42:54 +10:00 committed by Joakim Erdfelt
parent b8e4f72e38
commit 935d585194
10 changed files with 155 additions and 165 deletions

View File

@ -43,7 +43,22 @@
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>generate-resources</phase>
<id>populate distribution from home</id>
<phase>process-resources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<copy todir="${assembly-directory}">
<fileset dir="${home-directory}/jetty-home-${project.version}/" />
</copy>
</tasks>
</configuration>
</execution>
<execution>
<id>set jetty.sh</id>
<phase>process-resources</phase>
<goals>
<goal>run</goal>
</goals>

View File

@ -2,8 +2,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>
<artifactId>jetty-project</artifactId>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-project</artifactId>
<version>9.4.6-SNAPSHOT</version>
</parent>
@ -13,7 +13,7 @@
<properties>
<hazelcast.version>3.8.2</hazelcast.version>
<bundle-symbolic-name>${project.groupId}.session</bundle-symbolic-name>
<bundle-symbolic-name>${project.groupId}.hazelcast</bundle-symbolic-name>
</properties>
<dependencies>
@ -65,83 +65,6 @@
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<executions>
<execution>
<goals>
<goal>manifest</goal>
</goals>
<configuration>
<instructions>
<Export-Package>
org.eclipse.jetty.hazelcast.session.*;version="${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}";
</Export-Package>
</instructions>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>build-deps-file</id>
<phase>generate-resources</phase>
<goals>
<goal>list</goal>
</goals>
<configuration>
<appendOutput>false</appendOutput>
<outputFile>${project.build.directory}/deps.txt</outputFile>
<sort>true</sort>
<excludeGroupIds>org.eclipse.jetty</excludeGroupIds>
<prependGroupId>true</prependGroupId>
<includeScope>runtime</includeScope>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>process-deps</id>
<phase>process-resources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<replaceregexp file="${project.build.directory}/deps.txt"
match="The following files have been resolved:"
replace="[files]"
/>
</tasks>
</configuration>
</execution>
<execution>
<id>process-mod</id>
<phase>process-resources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<concat destfile="${project.build.directory}/hazelcast-datastore.mod">
<fileset file="src/main/config-template/modules/hazelcast-datastore.mod"/>
<fileset file="${project.build.directory}/deps.txt"/>
</concat>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
@ -152,9 +75,9 @@
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>src/main/assembly/config.xml</descriptor>
</descriptors>
<descriptorRefs>
<descriptorRef>config</descriptorRef>
</descriptorRefs>
</configuration>
</execution>
</executions>

View File

@ -1,27 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<assembly>
<id>config</id>
<includeBaseDirectory>false</includeBaseDirectory>
<formats>
<format>jar</format>
</formats>
<fileSets>
<fileSet>
<directory>src/main/config-template</directory>
<outputDirectory></outputDirectory>
<includes>
<include>**</include>
</includes>
<excludes>
<exclude>**/session-store-hazelcast.mod</exclude>
</excludes>
</fileSet>
<fileSet>
<directory>target</directory>
<outputDirectory>modules</outputDirectory>
<includes>
<include>session-store-hazelcast.mod</include>
</includes>
</fileSet>
</fileSets>
</assembly>

View File

@ -1,18 +0,0 @@
<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_3.dtd">
<Configure id="Server" class="org.eclipse.jetty.server.Server">
<!-- ===================================================================== -->
<!-- Configure a factory HazelcastSessionDataStoreaMap -->
<!-- ===================================================================== -->
<Call name="addBean">
<Arg>
<New id="sessionDataStoreFactory" class="org.eclipse.jetty.hazelcast.session.HazelcastSessionDataStoreFactory">
</New>
</Arg>
</Call>
</Configure>

View File

@ -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

View File

@ -0,0 +1,33 @@
<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_3.dtd">
<Configure id="Server" class="org.eclipse.jetty.server.Server">
<!-- ===================================================================== -->
<!-- Get a reference to the default local Hazelcast Instance. -->
<!-- ===================================================================== -->
<!--
<New id="hazelcastInstance" class="com.hazelcast.core.HazelcastInstance">
</New>
-->
<!-- ===================================================================== -->
<!-- Configure a factory for HazelcastSessionDataStore using -->
<!-- an embedded Hazelcast Instance -->
<!-- ===================================================================== -->
<Call name="addBean">
<Arg>
<New id="sessionDataStoreFactory" class="org.eclipse.jetty.hazelcast.session.HazelcastSessionDataStoreFactory">
<!--
<Set name="hazelcastInstance"><Ref id="hazelcastInstance"/></Set>
-->
<!--
<Set name="configurationLocation">
<Property name="jetty.session.configurationLocation" default="0"/>
</Set>
-->
</New>
</Arg>
</Call>
</Configure>

View File

@ -0,0 +1,33 @@
<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_3.dtd">
<Configure id="Server" class="org.eclipse.jetty.server.Server">
<!-- ===================================================================== -->
<!-- Get a reference to the default local Hazelcast Instance. -->
<!-- ===================================================================== -->
<!--
<New id="hazelcastInstance" class="com.hazelcast.core.HazelcastInstance">
</New>
-->
<!-- ===================================================================== -->
<!-- Configure a factory for HazelcastSessionDataStore using -->
<!-- an embedded Hazelcast Instance -->
<!-- ===================================================================== -->
<Call name="addBean">
<Arg>
<New id="sessionDataStoreFactory" class="org.eclipse.jetty.hazelcast.session.HazelcastSessionDataStoreFactory">
<!--
<Set name="hazelcastInstance"><Ref id="hazelcastInstance"/></Set>
-->
<!--
<Set name="configurationLocation">
<Property name="jetty.session.configurationLocation" default="0"/>
</Set>
-->
</New>
</Arg>
</Call>
</Configure>

View File

@ -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

View File

@ -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

View File

@ -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;