From f86d08ca5598571410386372f3f06d5c8c686c74 Mon Sep 17 00:00:00 2001 From: "a.sreekumar" Date: Tue, 9 Feb 2021 18:21:49 +0000 Subject: Changes related to multi policy handling improvement in APEX This review fixes an issue identified during testing the changes done for improving multiple policy handling in APEX. Changes done to a few test files in the previous review are reverted as well. Change-Id: I98324da708239d314aadd4c45dc377137fd552ba Issue-ID: POLICY-2883 Signed-off-by: a.sreekumar --- .../policy/apex/service/engine/main/ApexMain.java | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'services/services-engine/src/main') diff --git a/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/main/ApexMain.java b/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/main/ApexMain.java index 65c2acffa..3e9072dd4 100644 --- a/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/main/ApexMain.java +++ b/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/main/ApexMain.java @@ -71,7 +71,7 @@ public class ApexMain { * @param args the command line arguments * @throws ApexException the apex exception. */ - public ApexMain(final String[] args) throws ApexException { + public ApexMain(final String[] args) { LOGGER.entry("Starting Apex service with parameters " + Arrays.toString(args) + " . . ."); try { apexParameters = populateApexParameters(args); @@ -79,17 +79,18 @@ public class ApexMain { LOGGER.error(APEX_SERVICE_FAILED_MSG, e); return; } - aggregateParametersAndRegister(); + try { + aggregateParametersAndRegister(); - // Now, create the activator for the Apex service - activator = new ApexActivator(apexParameters); + // Now, create the activator for the Apex service + activator = new ApexActivator(apexParameters); - // Start the activator - try { + // Start the activator activator.initialize(); setAlive(true); - } catch (final ApexActivatorException e) { - throw new ApexException("start of Apex service failed, used parameters are " + Arrays.toString(args), e); + } catch (final ApexException e) { + LOGGER.error("start of Apex service failed, used parameters are {}", Arrays.toString(args), e); + return; } // Add a shutdown hook to shut everything down in an orderly manner @@ -246,7 +247,7 @@ public class ApexMain { * @param args the arguments * @throws ApexException the apex exception. */ - public static void main(final String[] args) throws ApexException { + public static void main(final String[] args) { new ApexMain(args); } } -- cgit 1.2.3-korg