aboutsummaryrefslogtreecommitdiffstats
path: root/policy-management/src/main/java
diff options
context:
space:
mode:
authoradheli.tavares <adheli.tavares@est.tech>2024-08-15 11:08:57 +0100
committeradheli.tavares <adheli.tavares@est.tech>2024-08-15 11:10:39 +0100
commit88744c04a7cfed3a4227bc2137102ff5fe69895f (patch)
tree5865844183729aed07f06dd2f94e4940e7ff80f1 /policy-management/src/main/java
parentf6d8e60eb75733cf9996bffb3c6ecb586f377da6 (diff)
PostgreSQL support for Drools
- moved all sql related management to db-migrator - any hardcoded variable related to database is configurable Issue-ID: POLICY-5107 Change-Id: I789895773ba8737651f68a0b494f72f947a147d1 Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
Diffstat (limited to 'policy-management/src/main/java')
-rw-r--r--policy-management/src/main/java/org/onap/policy/drools/features/PolicyEngineFeatureApi.java4
-rw-r--r--policy-management/src/main/java/org/onap/policy/drools/system/PolicyEngineManager.java14
2 files changed, 9 insertions, 9 deletions
diff --git a/policy-management/src/main/java/org/onap/policy/drools/features/PolicyEngineFeatureApi.java b/policy-management/src/main/java/org/onap/policy/drools/features/PolicyEngineFeatureApi.java
index 8edf394e..27b96999 100644
--- a/policy-management/src/main/java/org/onap/policy/drools/features/PolicyEngineFeatureApi.java
+++ b/policy-management/src/main/java/org/onap/policy/drools/features/PolicyEngineFeatureApi.java
@@ -182,7 +182,7 @@ public interface PolicyEngineFeatureApi extends OrderedService {
*
* @return true if this feature intercepts and takes ownership
* of the operation preventing the invocation of
- * lower priority features. False, otherwise..
+ * lower priority features. False, otherwise.
*/
default boolean afterLock(PolicyEngine engine) {
return false;
@@ -281,7 +281,7 @@ public interface PolicyEngineFeatureApi extends OrderedService {
* operation preventing the invocation of lower priority features. Null,
* otherwise
*/
- default PolicyResourceLockManager beforeCreateLockManager(PolicyEngine engine, Properties properties) {
+ default PolicyResourceLockManager beforeCreateLockManager() {
return null;
}
diff --git a/policy-management/src/main/java/org/onap/policy/drools/system/PolicyEngineManager.java b/policy-management/src/main/java/org/onap/policy/drools/system/PolicyEngineManager.java
index 0bc2318b..203d6bf2 100644
--- a/policy-management/src/main/java/org/onap/policy/drools/system/PolicyEngineManager.java
+++ b/policy-management/src/main/java/org/onap/policy/drools/system/PolicyEngineManager.java
@@ -342,7 +342,7 @@ class PolicyEngineManager implements PolicyEngine {
private void createLockManager(Properties properties) {
for (PolicyEngineFeatureApi feature : getEngineProviders()) {
try {
- this.lockManager = feature.beforeCreateLockManager(this, properties);
+ this.lockManager = feature.beforeCreateLockManager();
if (this.lockManager != null) {
logger.info("overridden lock manager is {}", this.lockManager);
return;
@@ -941,7 +941,7 @@ class PolicyEngineManager implements PolicyEngine {
@Override
public void run() {
try {
- doSleep(SHUTDOWN_MAX_GRACE_TIME);
+ doSleep();
logger.warn("{}: abnormal termination - shutdown graceful time period expiration",
PolicyEngineManager.this);
} catch (final InterruptedException e) {
@@ -960,18 +960,18 @@ class PolicyEngineManager implements PolicyEngine {
ex.getMessage(), ex));
logger.info("{}: exit", PolicyEngineManager.this);
- doExit(0);
+ doExit();
}
}
// these may be overridden by junit tests
- protected void doSleep(long sleepMs) throws InterruptedException {
- Thread.sleep(sleepMs);
+ protected void doSleep() throws InterruptedException {
+ Thread.sleep(ShutdownThread.SHUTDOWN_MAX_GRACE_TIME);
}
- protected void doExit(int code) {
- System.exit(code);
+ protected void doExit() {
+ System.exit(0);
}
}