From 9cf97c37b6d01142ce5b775dd319dc3d838294ac Mon Sep 17 00:00:00 2001 From: FrancescoFioraEst Date: Tue, 14 Mar 2023 12:48:45 +0000 Subject: Upgrade Demo ACM element microservice Upgrade chart Demo ACM element, upgrade servicetemplate example and fix prime issue Issue-ID: POLICY-4565 Change-Id: Icfc3a32f481840882eb6f20f25ed45b15d4991ff Signed-off-by: FrancescoFioraEst --- .../clamp/acm/runtime/commissioning/CommissioningProvider.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'runtime-acm/src/main/java') diff --git a/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/commissioning/CommissioningProvider.java b/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/commissioning/CommissioningProvider.java index 456e61c20..ca0b5c5ab 100644 --- a/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/commissioning/CommissioningProvider.java +++ b/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/commissioning/CommissioningProvider.java @@ -22,6 +22,8 @@ package org.onap.policy.clamp.acm.runtime.commissioning; import java.util.UUID; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; import java.util.stream.Collectors; import javax.ws.rs.core.Response.Status; import lombok.RequiredArgsConstructor; @@ -55,6 +57,8 @@ public class CommissioningProvider { private final AcTypeStateResolver acTypeStateResolver; private final ParticipantPrimePublisher participantPrimePublisher; + private final ExecutorService executor = Executors.newFixedThreadPool(1); + private CommissioningResponse createCommissioningResponse(UUID compositionId, ToscaServiceTemplate serviceTemplate) { var response = new CommissioningResponse(); @@ -193,7 +197,9 @@ public class CommissioningProvider { private void prime(AutomationCompositionDefinition acmDefinition) { var prearation = participantPrimePublisher.prepareParticipantPriming(acmDefinition); acDefinitionProvider.updateAcDefinition(acmDefinition); - participantPrimePublisher.sendPriming(prearation, acmDefinition.getCompositionId(), null); + + executor.execute( + () -> participantPrimePublisher.sendPriming(prearation, acmDefinition.getCompositionId(), null)); } private void deprime(AutomationCompositionDefinition acmDefinition) { @@ -204,7 +210,7 @@ public class CommissioningProvider { acmDefinition.setState(AcTypeState.DEPRIMING); acDefinitionProvider.updateAcDefinition(acmDefinition); } - participantPrimePublisher.sendDepriming(acmDefinition.getCompositionId()); + executor.execute(() -> participantPrimePublisher.sendDepriming(acmDefinition.getCompositionId())); } } -- cgit 1.2.3-korg