Skip to content

Commit 198ff4c

Browse files
committed
Merge 4.0-compatibility into master.
1 parent fc0df82 commit 198ff4c

File tree

62 files changed

+794
-1026
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+794
-1026
lines changed

LICENSE

Lines changed: 139 additions & 201 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
***Sample Code***: *Please see our <a href="https://github.com/hazelcast/hazelcast-code-samples/tree/master/hazelcast-integration/filter-based-session-replication" target="_blank">sample application</a> for Filter Based Web Session Replication.*
2020
<br></br>
2121

22+
***Note***: *Hazelcast 4.0+ is compatible with Hazelcast-WM 4.x. For older Hazelcast versions, use the latest Hazelcast-WM 3.x.x release.*
23+
<br></br>
24+
2225
Assume that you have more than one web server (A, B, C) with a load balancer in front of it. If server A goes down, your users on that server will be directed to one of the live servers (B or C), but their sessions will be lost.
2326

2427
We need to have all these sessions backed up somewhere if we do not want to lose the sessions upon server crashes. Hazelcast Web Manager (WM) allows you to cluster user HTTP sessions automatically.

build.xml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
<!--
2-
~ Copyright (c) 2008-2016, Hazelcast, Inc. All Rights Reserved.
2+
~ Copyright 2020 Hazelcast Inc.
33
~
4-
~ Licensed under the Apache License, Version 2.0 (the "License");
5-
~ you may not use this file except in compliance with the License.
6-
~ You may obtain a copy of the License at
4+
~ Licensed under the Hazelcast Community License (the "License"); you may not use
5+
~ this file except in compliance with the License. You may obtain a copy of the
6+
~ License at
77
~
8-
~ http://www.apache.org/licenses/LICENSE-2.0
8+
~ http://hazelcast.com/hazelcast-community-license
99
~
1010
~ Unless required by applicable law or agreed to in writing, software
11-
~ distributed under the License is distributed on an "AS IS" BASIS,
12-
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
~ See the License for the specific language governing permissions and
14-
~ limitations under the License.
11+
~ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+
~ WARRANTIES OF ANY KIND, either express or implied. See the License for the
13+
~ specific language governing permissions and limitations under the License.
1514
-->
1615

1716
<project basedir="." name="hazelcast" default="war">

checkstyle/ClassHeader.txt

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
/*
2-
* Copyright (c) 2008-2016, Hazelcast, Inc. All Rights Reserved.
2+
* Copyright 2020 Hazelcast Inc.
33
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
4+
* Licensed under the Hazelcast Community License (the "License"); you may not use
5+
* this file except in compliance with the License. You may obtain a copy of the
6+
* License at
77
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
8+
* http://hazelcast.com/hazelcast-community-license
99
*
1010
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
11+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+
* WARRANTIES OF ANY KIND, either express or implied. See the License for the
13+
* specific language governing permissions and limitations under the License.
1514
*/
1615

pom.xml

Lines changed: 11 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
<!--
2-
~ Copyright (c) 2008-2016, Hazelcast, Inc. All Rights Reserved.
2+
~ Copyright 2020 Hazelcast Inc.
33
~
4-
~ Licensed under the Apache License, Version 2.0 (the "License");
5-
~ you may not use this file except in compliance with the License.
6-
~ You may obtain a copy of the License at
4+
~ Licensed under the Hazelcast Community License (the "License"); you may not use
5+
~ this file except in compliance with the License. You may obtain a copy of the
6+
~ License at
77
~
8-
~ http://www.apache.org/licenses/LICENSE-2.0
8+
~ http://hazelcast.com/hazelcast-community-license
99
~
1010
~ Unless required by applicable law or agreed to in writing, software
11-
~ distributed under the License is distributed on an "AS IS" BASIS,
12-
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
~ See the License for the specific language governing permissions and
14-
~ limitations under the License.
11+
~ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+
~ WARRANTIES OF ANY KIND, either express or implied. See the License for the
13+
~ specific language governing permissions and limitations under the License.
1514
-->
1615
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1716
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
@@ -30,12 +29,12 @@
3029
<main.basedir>${project.basedir}</main.basedir>
3130
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
3231

33-
<jdk.version>1.6</jdk.version>
32+
<jdk.version>1.8</jdk.version>
3433
<target.dir>target</target.dir>
3534
<maven.build.timestamp.format>yyyyMMdd</maven.build.timestamp.format>
3635
<timestamp>${maven.build.timestamp}</timestamp>
3736

38-
<hazelcast.version>3.7</hazelcast.version>
37+
<hazelcast.version>4.0</hazelcast.version>
3938

4039
<log4j.version>1.2.12</log4j.version>
4140
<junit.version>4.12</junit.version>
@@ -66,13 +65,6 @@
6665
<maven.jacoco.plugin.version>0.7.9</maven.jacoco.plugin.version>
6766
</properties>
6867

69-
<licenses>
70-
<license>
71-
<name>The Apache Software License, Version 2.0</name>
72-
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
73-
<distribution>repo</distribution>
74-
</license>
75-
</licenses>
7668
<scm>
7769
<connection>scm:git:git://github.com/hazelcast/hazelcast-wm.git</connection>
7870
<developerConnection>scm:git:git@github.com:hazelcast/hazelcast-wm.git</developerConnection>
@@ -307,13 +299,6 @@
307299
<artifactId>hazelcast</artifactId>
308300
<version>${hazelcast.version}</version>
309301
</dependency>
310-
<dependency>
311-
<groupId>com.hazelcast</groupId>
312-
<artifactId>hazelcast-client</artifactId>
313-
<version>${hazelcast.version}</version>
314-
<scope>provided</scope>
315-
<optional>true</optional>
316-
</dependency>
317302
<dependency>
318303
<groupId>org.springframework</groupId>
319304
<artifactId>spring-core</artifactId>
@@ -590,21 +575,14 @@
590575
<profile>
591576
<id>master</id>
592577
<properties>
593-
<hazelcast.version>4.0-SNAPSHOT</hazelcast.version>
578+
<hazelcast.version>4.1-SNAPSHOT</hazelcast.version>
594579
</properties>
595580
<dependencies>
596581
<dependency>
597582
<groupId>com.hazelcast</groupId>
598583
<artifactId>hazelcast</artifactId>
599584
<version>${hazelcast.version}</version>
600585
</dependency>
601-
<dependency>
602-
<groupId>com.hazelcast</groupId>
603-
<artifactId>hazelcast-client</artifactId>
604-
<version>${hazelcast.version}</version>
605-
<scope>provided</scope>
606-
<optional>true</optional>
607-
</dependency>
608586
</dependencies>
609587
<build>
610588
<plugins>

src/main/java/com/hazelcast/web/ClusteredSessionService.java

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,31 @@
11
/*
2-
* Copyright (c) 2008-2016, Hazelcast, Inc. All Rights Reserved.
2+
* Copyright 2020 Hazelcast Inc.
33
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
4+
* Licensed under the Hazelcast Community License (the "License"); you may not use
5+
* this file except in compliance with the License. You may obtain a copy of the
6+
* License at
77
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
8+
* http://hazelcast.com/hazelcast-community-license
99
*
1010
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
11+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+
* WARRANTIES OF ANY KIND, either express or implied. See the License for the
13+
* specific language governing permissions and limitations under the License.
1514
*/
1615

1716
package com.hazelcast.web;
1817

1918
import com.hazelcast.core.HazelcastInstance;
20-
import com.hazelcast.core.IMap;
21-
import com.hazelcast.instance.OutOfMemoryErrorDispatcher;
19+
import com.hazelcast.internal.serialization.Data;
20+
import com.hazelcast.map.IMap;
21+
import com.hazelcast.instance.impl.OutOfMemoryErrorDispatcher;
2222
import com.hazelcast.logging.ILogger;
2323
import com.hazelcast.logging.Logger;
2424
import com.hazelcast.map.EntryProcessor;
2525
import com.hazelcast.map.impl.MapEntrySimple;
26-
import com.hazelcast.nio.serialization.Data;
2726
import com.hazelcast.spi.impl.SerializationServiceSupport;
28-
import com.hazelcast.spi.serialization.SerializationService;
29-
import com.hazelcast.util.ExceptionUtil;
27+
import com.hazelcast.internal.serialization.SerializationService;
28+
import com.hazelcast.internal.util.ExceptionUtil;
3029
import com.hazelcast.web.entryprocessor.DeleteSessionEntryProcessor;
3130
import com.hazelcast.web.entryprocessor.GetAttributeEntryProcessor;
3231
import com.hazelcast.web.entryprocessor.GetAttributeNamesEntryProcessor;

src/main/java/com/hazelcast/web/HazelcastHttpSession.java

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
/*
2-
* Copyright (c) 2008-2016, Hazelcast, Inc. All Rights Reserved.
2+
* Copyright 2020 Hazelcast Inc.
33
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
4+
* Licensed under the Hazelcast Community License (the "License"); you may not use
5+
* this file except in compliance with the License. You may obtain a copy of the
6+
* License at
77
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
8+
* http://hazelcast.com/hazelcast-community-license
99
*
1010
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
11+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+
* WARRANTIES OF ANY KIND, either express or implied. See the License for the
13+
* specific language governing permissions and limitations under the License.
1514
*/
1615

1716
package com.hazelcast.web;

src/main/java/com/hazelcast/web/HazelcastInstanceLoader.java

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
/*
2-
* Copyright (c) 2008-2016, Hazelcast, Inc. All Rights Reserved.
2+
* Copyright 2020 Hazelcast Inc.
33
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
4+
* Licensed under the Hazelcast Community License (the "License"); you may not use
5+
* this file except in compliance with the License. You may obtain a copy of the
6+
* License at
77
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
8+
* http://hazelcast.com/hazelcast-community-license
99
*
1010
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
11+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+
* WARRANTIES OF ANY KIND, either express or implied. See the License for the
13+
* specific language governing permissions and limitations under the License.
1514
*/
1615

1716
package com.hazelcast.web;
@@ -98,7 +97,14 @@ private static HazelcastInstance createClient(ClusteredSessionService sessionSer
9897
}
9998
}
10099
if (filterConfig.isStickySession()) {
101-
clientConfig.getNetworkConfig().setConnectionAttemptLimit(1);
100+
int initialBackoffMillis = clientConfig.getConnectionStrategyConfig()
101+
.getConnectionRetryConfig().getInitialBackoffMillis();
102+
double multiplier = clientConfig
103+
.getConnectionStrategyConfig().getConnectionRetryConfig().getMultiplier();
104+
105+
// Limit connection attempts by 1
106+
clientConfig.getConnectionStrategyConfig().getConnectionRetryConfig()
107+
.setMaxBackoffMillis(initialBackoffMillis * (int) multiplier);
102108
}
103109

104110
clientConfig.addListenerConfig(new ListenerConfig(new ClientLifecycleListener(sessionService)));

src/main/java/com/hazelcast/web/LocalCacheEntry.java

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
/*
2-
* Copyright (c) 2008-2016, Hazelcast, Inc. All Rights Reserved.
2+
* Copyright 2020 Hazelcast Inc.
33
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
4+
* Licensed under the Hazelcast Community License (the "License"); you may not use
5+
* this file except in compliance with the License. You may obtain a copy of the
6+
* License at
77
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
8+
* http://hazelcast.com/hazelcast-community-license
99
*
1010
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
11+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+
* WARRANTIES OF ANY KIND, either express or implied. See the License for the
13+
* specific language governing permissions and limitations under the License.
1514
*/
1615

1716
package com.hazelcast.web;

src/main/java/com/hazelcast/web/SessionListener.java

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
/*
2-
* Copyright (c) 2008-2016, Hazelcast, Inc. All Rights Reserved.
2+
* Copyright 2020 Hazelcast Inc.
33
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
4+
* Licensed under the Hazelcast Community License (the "License"); you may not use
5+
* this file except in compliance with the License. You may obtain a copy of the
6+
* License at
77
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
8+
* http://hazelcast.com/hazelcast-community-license
99
*
1010
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
11+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+
* WARRANTIES OF ANY KIND, either express or implied. See the License for the
13+
* specific language governing permissions and limitations under the License.
1514
*/
1615

1716
package com.hazelcast.web;

0 commit comments

Comments
 (0)