aboutsummaryrefslogtreecommitdiffstats
path: root/cps-ncmp-service/src/main/java/org/onap
diff options
context:
space:
mode:
authoremaclee <lee.anjella.macabuhay@est.tech>2022-05-06 10:36:29 +0100
committeremaclee <lee.anjella.macabuhay@est.tech>2022-05-12 11:32:10 +0100
commit0b80343610a215f26a7d764cc849f8e9ca44fea0 (patch)
tree17f7c19af4d1e5dc1c3c9692e14080daf982bd52 /cps-ncmp-service/src/main/java/org/onap
parentac5ae3e24e347bb6d643e9b4e5ebcf3baa7152a2 (diff)
Add graceful shutdown for Session Manager
Introduce singleton session manager Add unit test for session manager Issue-Id: CPS-898 Signed-off-by: emaclee <lee.anjella.macabuhay@est.tech> Change-Id: Iaf91f1aa6c1ebfe0ab907e7f7d80a01e940a0fdd
Diffstat (limited to 'cps-ncmp-service/src/main/java/org/onap')
-rw-r--r--cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/config/NcmpConfiguration.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/config/NcmpConfiguration.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/config/NcmpConfiguration.java
index 60b44c2461..b04619e336 100644
--- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/config/NcmpConfiguration.java
+++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/config/NcmpConfiguration.java
@@ -1,6 +1,6 @@
/*
* ============LICENSE_START=======================================================
- * Copyright (C) 2021 Nordix Foundation
+ * Copyright (C) 2021-2022 Nordix Foundation
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -23,6 +23,7 @@ package org.onap.cps.ncmp.api.impl.config;
import java.util.Arrays;
import lombok.Getter;
import org.springframework.beans.factory.annotation.Value;
+import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@@ -53,7 +54,7 @@ public class NcmpConfiguration {
* @return rest template instance
*/
@Bean
- @Scope("singleton")
+ @Scope(ConfigurableBeanFactory.SCOPE_SINGLETON)
public static RestTemplate restTemplate(final RestTemplateBuilder restTemplateBuilder) {
final RestTemplate restTemplate = restTemplateBuilder.build();
setRestTemplateMessageConverters(restTemplate);