diff --git a/jetty-hazelcast/src/main/config/etc/sessions/hazelcast/remote.xml b/jetty-hazelcast/src/main/config/etc/sessions/hazelcast/remote.xml index 96588eab19f6..c67f8dff1d9b 100644 --- a/jetty-hazelcast/src/main/config/etc/sessions/hazelcast/remote.xml +++ b/jetty-hazelcast/src/main/config/etc/sessions/hazelcast/remote.xml @@ -4,7 +4,7 @@ - + @@ -15,6 +15,7 @@ + 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 index 3d8ba5a11747..3b5970948a5f 100644 --- a/jetty-hazelcast/src/main/config/modules/session-store-hazelcast-embedded.mod +++ b/jetty-hazelcast/src/main/config/modules/session-store-hazelcast-embedded.mod @@ -31,7 +31,6 @@ 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.hazelcast.scavengeZombies=false jetty.session.gracePeriod.seconds=3600 jetty.session.savePeriod.seconds=0 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 index e3d67a3d3878..9bf4db8f7951 100644 --- a/jetty-hazelcast/src/main/config/modules/session-store-hazelcast-remote.mod +++ b/jetty-hazelcast/src/main/config/modules/session-store-hazelcast-remote.mod @@ -34,6 +34,6 @@ jetty.session.hazelcast.mapName=jetty-distributed-session-map jetty.session.hazelcast.hazelcastInstanceName=JETTY_DISTRIBUTED_SESSION_INSTANCE jetty.session.hazelcast.onlyClient=true jetty.session.hazelcast.scavengeZombies=false -#jetty.session.hazelcast.configurationLocation= jetty.session.gracePeriod.seconds=3600 jetty.session.savePeriod.seconds=0 +#jetty.session.hazelcast.addresses= 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 bc2eea0698ea..d637711488fe 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 @@ -19,6 +19,7 @@ package org.eclipse.jetty.hazelcast.session; import java.io.IOException; +import java.util.Arrays; import com.hazelcast.client.HazelcastClient; import com.hazelcast.client.config.ClientConfig; @@ -29,6 +30,7 @@ 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.SessionData; import org.eclipse.jetty.server.session.SessionDataStore; @@ -57,6 +59,8 @@ public class HazelcastSessionDataStoreFactory private boolean scavengeZombies = false; + private String addresses; + public boolean isScavengeZombies() { return scavengeZombies; @@ -81,6 +85,12 @@ public SessionDataStore getSessionDataStore(SessionHandler handler) if (configurationLocation == null) { ClientConfig config = new ClientConfig(); + + if (addresses != null && !addresses.isEmpty()) + { + config.getNetworkConfig().setAddresses(Arrays.asList(addresses.split(","))); + } + SerializerConfig sc = new SerializerConfig() .setImplementation(new SessionDataSerializer()) .setTypeClass(SessionData.class); @@ -201,4 +211,14 @@ public void setHazelcastInstanceName(String hazelcastInstanceName) { this.hazelcastInstanceName = hazelcastInstanceName; } + + public String getAddresses() + { + return addresses; + } + + public void setAddresses(String addresses) + { + this.addresses = addresses; + } }