diff options
author | Jorge Hernandez <jh1730@att.com> | 2018-04-16 14:06:32 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2018-04-16 14:06:32 +0000 |
commit | 8658906abfac84d568381d15504cd3f7ac36108e (patch) | |
tree | 629e11379404a4c7d4ab00aba55b5996f7d902ae /feature-distributed-locking/src/main | |
parent | 7bfe22230193a39c55df944a555bfcaf498f3d1c (diff) | |
parent | ec1f090c8f41edff7d4f9a571b3489dfe54d44cb (diff) |
Merge "Sonar cleanup"
Diffstat (limited to 'feature-distributed-locking/src/main')
-rw-r--r-- | feature-distributed-locking/src/main/java/org/onap/policy/distributed/locking/DistributedLockingFeature.java | 10 |
1 files changed, 9 insertions, 1 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 5994beb6..019452a0 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 @@ -119,7 +119,7 @@ public class DistributedLockingFeature implements PolicyEngineFeatureAPI, Policy long heartbeatInterval = this.lockProps.getHeartBeatIntervalProperty(); cleanLockTable(); - heartbeat = new Heartbeat(uuid, lockProps); + initHeartbeat(lockProps); this.scheduledExecutorService = Executors.newScheduledThreadPool(1); this.scheduledExecutorService.scheduleAtFixedRate(heartbeat, heartbeatInterval, heartbeatInterval, TimeUnit.MILLISECONDS); @@ -158,6 +158,14 @@ public class DistributedLockingFeature implements PolicyEngineFeatureAPI, Policy } + /** + * Initialize the static heartbeat object + */ + private static void initHeartbeat(DistributedLockingProperties lockProps) { + heartbeat = new Heartbeat(uuid, lockProps); + + } + public static Heartbeat getHeartbeat() { return heartbeat; } |