summaryrefslogtreecommitdiffstats
path: root/feature-drools-init/src
diff options
context:
space:
mode:
Diffstat (limited to 'feature-drools-init/src')
-rw-r--r--feature-drools-init/src/main/java/org/onap/policy/drools/droolsinit/DroolsInitFeature.java16
1 files changed, 6 insertions, 10 deletions
diff --git a/feature-drools-init/src/main/java/org/onap/policy/drools/droolsinit/DroolsInitFeature.java b/feature-drools-init/src/main/java/org/onap/policy/drools/droolsinit/DroolsInitFeature.java
index b3b8485c..f97ed759 100644
--- a/feature-drools-init/src/main/java/org/onap/policy/drools/droolsinit/DroolsInitFeature.java
+++ b/feature-drools-init/src/main/java/org/onap/policy/drools/droolsinit/DroolsInitFeature.java
@@ -72,16 +72,12 @@ public class DroolsInitFeature implements PolicySessionFeatureApi {
final FactHandle factHandle = policySession.getKieSession().insert(this);
// after 10 minutes, remove the object from Drools memory (if needed)
- PolicyEngineConstants.getManager().getExecutorService().schedule(
- new Runnable() {
- @Override
- public void run() {
- if (policySession.getKieSession().getObject(factHandle) != null) {
- // object has not been removed by application -- remove it here
- policySession.getKieSession().delete(factHandle);
- }
- }
- }, DELAY, TimeUnit.MILLISECONDS);
+ PolicyEngineConstants.getManager().getExecutorService().schedule(() -> {
+ if (policySession.getKieSession().getObject(factHandle) != null) {
+ // object has not been removed by application -- remove it here
+ policySession.getKieSession().delete(factHandle);
+ }
+ }, DELAY, TimeUnit.MILLISECONDS);
}
}
}