summaryrefslogtreecommitdiffstats
path: root/feature-lifecycle/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'feature-lifecycle/src/main')
-rw-r--r--feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/LifecycleFsm.java9
-rw-r--r--feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/LifecycleStateRunning.java8
2 files changed, 9 insertions, 8 deletions
diff --git a/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/LifecycleFsm.java b/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/LifecycleFsm.java
index 67f5467b..36d2a545 100644
--- a/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/LifecycleFsm.java
+++ b/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/LifecycleFsm.java
@@ -45,7 +45,8 @@ import org.onap.policy.common.gson.annotation.GsonJsonIgnore;
import org.onap.policy.common.utils.coder.StandardCoderObject;
import org.onap.policy.common.utils.network.NetworkUtil;
import org.onap.policy.drools.controller.DroolsController;
-import org.onap.policy.drools.persistence.SystemPersistence;
+import org.onap.policy.drools.controller.DroolsControllerConstants;
+import org.onap.policy.drools.persistence.SystemPersistenceConstants;
import org.onap.policy.drools.system.PolicyController;
import org.onap.policy.models.pdp.concepts.PdpResponseDetails;
import org.onap.policy.models.pdp.concepts.PdpStateChange;
@@ -116,7 +117,7 @@ public class LifecycleFsm implements Startable {
* Constructor.
*/
public LifecycleFsm() {
- this.properties = SystemPersistence.manager.getProperties(CONFIGURATION_PROPERTIES_NAME);
+ this.properties = SystemPersistenceConstants.getManager().getProperties(CONFIGURATION_PROPERTIES_NAME);
scheduler.setContinueExistingPeriodicTasksAfterShutdownPolicy(false);
scheduler.setExecuteExistingDelayedTasksAfterShutdownPolicy(false);
@@ -305,7 +306,7 @@ public class LifecycleFsm implements Startable {
private boolean startTimers() {
statusTask =
- this.scheduler.scheduleAtFixedRate(() -> status(), 0, statusTimerSeconds, TimeUnit.SECONDS);
+ this.scheduler.scheduleAtFixedRate(this::status, 0, statusTimerSeconds, TimeUnit.SECONDS);
return !statusTask.isCancelled() && !statusTask.isDone();
}
@@ -381,7 +382,7 @@ public class LifecycleFsm implements Startable {
private List<ToscaPolicyTypeIdentifier> getCapabilities() {
List<ToscaPolicyTypeIdentifier> capabilities = new ArrayList<>();
- for (DroolsController dc : DroolsController.factory.inventory()) {
+ for (DroolsController dc : DroolsControllerConstants.getFactory().inventory()) {
if (!dc.isBrained()) {
continue;
}
diff --git a/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/LifecycleStateRunning.java b/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/LifecycleStateRunning.java
index d5820d08..c5ea44b2 100644
--- a/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/LifecycleStateRunning.java
+++ b/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/LifecycleStateRunning.java
@@ -42,6 +42,10 @@ public abstract class LifecycleStateRunning extends LifecycleStateDefault {
private static final Logger logger = LoggerFactory.getLogger(LifecycleStateRunning.class);
+ protected LifecycleStateRunning(LifecycleFsm manager) {
+ super(manager);
+ }
+
protected abstract boolean stateChangeToPassive(@NonNull PdpStateChange change);
protected abstract boolean stateChangeToActive(@NonNull PdpStateChange change);
@@ -50,10 +54,6 @@ public abstract class LifecycleStateRunning extends LifecycleStateDefault {
protected abstract boolean undeployPolicy(@NonNull PolicyController controller, @NonNull ToscaPolicy policy);
- protected LifecycleStateRunning(LifecycleFsm manager) {
- super(manager);
- }
-
@Override
public boolean start() {
logger.warn("{}: start", this);