diff options
author | grabinsk <maciej.grabinski@nokia.com> | 2019-07-02 16:05:24 +0200 |
---|---|---|
committer | grabinsk <maciej.grabinski@nokia.com> | 2019-07-02 16:05:24 +0200 |
commit | ce3730c7286f03375f38215a50af1ae6530a4845 (patch) | |
tree | 1a088ea9827d6575cd264a114cebb2ac74f31ec1 | |
parent | 768ab8275b35750ebf46411be54e7bd452a95578 (diff) |
fix CbsConfiguration update bug
'CbsConfiguration' bean is statefull. The singleton instance lifespan should match application lifespan.
The problem was bootstrap context (and all it's beans) are destroyed during bootstrap context refresh.
Change-Id: Ib02cd49c37935422d4ca861afee55f621015146e
Issue-ID: DCAEGEN2-1647
Signed-off-by: grabinsk <maciej.grabinski@nokia.com>
-rw-r--r-- | prh-app-server/src/main/java/org/onap/dcaegen2/services/bootstrap/CbsBootstrapConfiguration.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/prh-app-server/src/main/java/org/onap/dcaegen2/services/bootstrap/CbsBootstrapConfiguration.java b/prh-app-server/src/main/java/org/onap/dcaegen2/services/bootstrap/CbsBootstrapConfiguration.java index df318550..f668a581 100644 --- a/prh-app-server/src/main/java/org/onap/dcaegen2/services/bootstrap/CbsBootstrapConfiguration.java +++ b/prh-app-server/src/main/java/org/onap/dcaegen2/services/bootstrap/CbsBootstrapConfiguration.java @@ -30,6 +30,7 @@ import org.springframework.context.annotation.Configuration; @Configuration @EnableConfigurationProperties(CbsProperties.class) public class CbsBootstrapConfiguration { + private static final CbsConfiguration CBS_CONFIGURATION = new CbsConfiguration(); @Bean public CbsProperties cbsProperties() { @@ -52,6 +53,6 @@ public class CbsBootstrapConfiguration { @Bean public CbsConfiguration cbsConfiguration() { - return new CbsConfiguration(); + return CBS_CONFIGURATION; } } |