diff options
author | Toine Siebelink <toine.siebelink@est.tech> | 2024-06-06 08:16:39 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2024-06-06 08:16:39 +0000 |
commit | f8ca09bf4e5d76fb95bd1eda17f15a7fd92d0f63 (patch) | |
tree | 050f4c34ffd7f247beee4392697184b80642dbb3 /cps-ncmp-service/src/main | |
parent | 1decb39aa016bdfc7ac870aec738c9c08484c32f (diff) | |
parent | da0af8d3c666a06fad03099118343d47144e0b17 (diff) |
Merge "Change ApplicationEvent for ModelLoading"
Diffstat (limited to 'cps-ncmp-service/src/main')
-rw-r--r-- | cps-ncmp-service/src/main/java/org/onap/cps/ncmp/init/AbstractModelLoader.java | 6 | ||||
-rw-r--r-- | cps-ncmp-service/src/main/java/org/onap/cps/ncmp/init/ModelLoader.java | 8 |
2 files changed, 7 insertions, 7 deletions
diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/init/AbstractModelLoader.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/init/AbstractModelLoader.java index 4cc8cdaa66..554501127c 100644 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/init/AbstractModelLoader.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/init/AbstractModelLoader.java @@ -39,7 +39,7 @@ import org.onap.cps.spi.exceptions.AlreadyDefinedException; import org.onap.cps.utils.JsonObjectMapper; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.SpringApplication; -import org.springframework.boot.context.event.ApplicationReadyEvent; +import org.springframework.boot.context.event.ApplicationStartedEvent; @Slf4j @RequiredArgsConstructor @@ -61,12 +61,12 @@ abstract class AbstractModelLoader implements ModelLoader { long retryTimeMs; @Override - public void onApplicationEvent(@NonNull final ApplicationReadyEvent applicationReadyEvent) { + public void onApplicationEvent(@NonNull final ApplicationStartedEvent applicationStartedEvent) { try { onboardOrUpgradeModel(); } catch (final NcmpStartUpException ncmpStartUpException) { log.error("Onboarding model for NCMP failed: {} ", ncmpStartUpException.getMessage()); - SpringApplication.exit(applicationReadyEvent.getApplicationContext(), () -> EXIT_CODE_ON_ERROR); + SpringApplication.exit(applicationStartedEvent.getApplicationContext(), () -> EXIT_CODE_ON_ERROR); } } diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/init/ModelLoader.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/init/ModelLoader.java index c61bf1c9b1..9832ba3f9e 100644 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/init/ModelLoader.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/init/ModelLoader.java @@ -1,6 +1,6 @@ /* * ============LICENSE_START======================================================= - * Copyright (C) 2023 Nordix Foundation + * Copyright (C) 2023-2024 Nordix Foundation * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,13 +21,13 @@ package org.onap.cps.ncmp.init; import lombok.NonNull; -import org.springframework.boot.context.event.ApplicationReadyEvent; +import org.springframework.boot.context.event.ApplicationStartedEvent; import org.springframework.context.ApplicationListener; -public interface ModelLoader extends ApplicationListener<ApplicationReadyEvent> { +public interface ModelLoader extends ApplicationListener<ApplicationStartedEvent> { @Override - void onApplicationEvent(@NonNull ApplicationReadyEvent applicationReadyEvent); + void onApplicationEvent(@NonNull ApplicationStartedEvent applicationStartedEvent); void onboardOrUpgradeModel(); |