aboutsummaryrefslogtreecommitdiffstats
path: root/feature-distributed-locking/src/main/java/org/onap/policy/distributed/locking/DistributedLockingFeature.java
diff options
context:
space:
mode:
Diffstat (limited to 'feature-distributed-locking/src/main/java/org/onap/policy/distributed/locking/DistributedLockingFeature.java')
-rw-r--r--feature-distributed-locking/src/main/java/org/onap/policy/distributed/locking/DistributedLockingFeature.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/feature-distributed-locking/src/main/java/org/onap/policy/distributed/locking/DistributedLockingFeature.java b/feature-distributed-locking/src/main/java/org/onap/policy/distributed/locking/DistributedLockingFeature.java
index cc7a7a12..3d19c873 100644
--- a/feature-distributed-locking/src/main/java/org/onap/policy/distributed/locking/DistributedLockingFeature.java
+++ b/feature-distributed-locking/src/main/java/org/onap/policy/distributed/locking/DistributedLockingFeature.java
@@ -65,9 +65,12 @@ public class DistributedLockingFeature implements PolicyEngineFeatureAPI, Policy
*/
private static final UUID uuid = UUID.randomUUID();
+
/**
- * Config directory
+ * Reference to Heartbeat
*/
+ private static Heartbeat heartbeat = null;
+
@Override
public int getSequenceNumber() {
return 1000;
@@ -116,7 +119,7 @@ public class DistributedLockingFeature implements PolicyEngineFeatureAPI, Policy
long heartbeatInterval = this.lockProps.getHeartBeatIntervalProperty();
cleanLockTable();
- Heartbeat heartbeat = new Heartbeat(this.uuid, lockProps);
+ heartbeat = new Heartbeat(this.uuid, lockProps);
this.scheduledExecutorService = Executors.newScheduledThreadPool(1);
this.scheduledExecutorService.scheduleAtFixedRate(heartbeat, heartbeatInterval, heartbeatInterval, TimeUnit.MILLISECONDS);
@@ -154,5 +157,9 @@ public class DistributedLockingFeature implements PolicyEngineFeatureAPI, Policy
}
}
+
+ public static Heartbeat getHeartbeat() {
+ return heartbeat;
+ }
}