aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/plugins-context/plugins-context-locking/plugins-context-locking-hazelcast/src/main/java/org/onap/policy/apex/plugins/context/locking/hazelcast/HazelcastLock.java17
-rw-r--r--plugins/pom.xml3
2 files changed, 11 insertions, 9 deletions
diff --git a/plugins/plugins-context/plugins-context-locking/plugins-context-locking-hazelcast/src/main/java/org/onap/policy/apex/plugins/context/locking/hazelcast/HazelcastLock.java b/plugins/plugins-context/plugins-context-locking/plugins-context-locking-hazelcast/src/main/java/org/onap/policy/apex/plugins/context/locking/hazelcast/HazelcastLock.java
index e676e665e..caec244b8 100644
--- a/plugins/plugins-context/plugins-context-locking/plugins-context-locking-hazelcast/src/main/java/org/onap/policy/apex/plugins/context/locking/hazelcast/HazelcastLock.java
+++ b/plugins/plugins-context/plugins-context-locking/plugins-context-locking-hazelcast/src/main/java/org/onap/policy/apex/plugins/context/locking/hazelcast/HazelcastLock.java
@@ -1,19 +1,20 @@
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ * Modifications Copyright (C) 2021 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- *
+ *
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
@@ -21,7 +22,7 @@
package org.onap.policy.apex.plugins.context.locking.hazelcast;
import com.hazelcast.core.HazelcastInstance;
-import com.hazelcast.core.ILock;
+import com.hazelcast.cp.lock.FencedLock;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReadWriteLock;
@@ -35,8 +36,8 @@ public class HazelcastLock implements ReadWriteLock {
private final String lockId;
// The hazelcast lock
- private final ILock readLock;
- private final ILock writeLock;
+ private final FencedLock readLock;
+ private final FencedLock writeLock;
/**
* Create a Hazelcast lock.
@@ -48,8 +49,8 @@ public class HazelcastLock implements ReadWriteLock {
this.lockId = lockId;
// Create the Hazelcast read and write locks
- readLock = hazelcastInstance.getLock(lockId + "_READ");
- writeLock = hazelcastInstance.getLock(lockId + "_WRITE");
+ readLock = hazelcastInstance.getCPSubsystem().getLock(lockId + "_READ");
+ writeLock = hazelcastInstance.getCPSubsystem().getLock(lockId + "_WRITE");
}
/**
diff --git a/plugins/pom.xml b/plugins/pom.xml
index b10e8650b..e872e0fa8 100644
--- a/plugins/pom.xml
+++ b/plugins/pom.xml
@@ -1,6 +1,7 @@
<!--
============LICENSE_START=======================================================
Copyright (C) 2018 Ericsson. All rights reserved.
+ Modifications Copyright (C) 2021 Nordix Foundation.
================================================================================
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -34,7 +35,7 @@
<description>Plugins for Apex that can be implemented with various 3PPs are implemented here.</description>
<properties>
- <version.hazelcast>3.11-BETA-1</version.hazelcast>
+ <version.hazelcast>4.1.1</version.hazelcast>
</properties>
<modules>