diff options
author | liamfallon <liam.fallon@ericsson.com> | 2018-09-12 16:12:14 +0100 |
---|---|---|
committer | liamfallon <liam.fallon@ericsson.com> | 2018-09-12 16:21:43 +0100 |
commit | cce09d08ead0c7cf152b2e63374a18e04b280b61 (patch) | |
tree | ebbe32d73198da6f842eab41eac0e600195bcad9 /core | |
parent | 2b5cf360ba9b494a7df1d2c06c7a736b9d557d47 (diff) |
Fix soft stop and start of engine
Stopping an apexc engine is a soft stop, allowing the engine
to be restarted again. However, when a model upgrade is carried out
the engine must be stopped and cleared to clear the previous model,
loaded with the new model and started again.
THis handling must work over the Web Socket admin interface and
also when apex is started as a service.
This change fixes the handling so that it is consistent and
works the same when apex is stopped/started/upgraded from
the command line or over the management web socket interface
Issue-ID: POLICY-1101
Change-Id: I1fe619641cb6ecd34d0669b4b7df105280e5e2c0
Signed-off-by: liamfallon <liam.fallon@ericsson.com>
Diffstat (limited to 'core')
-rw-r--r-- | core/core-engine/src/main/java/org/onap/policy/apex/core/engine/engine/impl/ApexEngineImpl.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/engine/impl/ApexEngineImpl.java b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/engine/impl/ApexEngineImpl.java index 3349b609f..3497ed660 100644 --- a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/engine/impl/ApexEngineImpl.java +++ b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/engine/impl/ApexEngineImpl.java @@ -247,8 +247,11 @@ public class ApexEngineImpl implements ApexEngine { // Clear everything stateMachineHandler = null; engineStats.clean(); - internalContext.clear(); - internalContext = null; + + if (internalContext != null) { + internalContext.clear(); + internalContext = null; + } } /* |