From 97d42f7035ade2c171c349d01cfcd9b61b71dd52 Mon Sep 17 00:00:00 2001 From: Ittay Stern Date: Wed, 6 Nov 2019 14:27:53 +0200 Subject: fix - when retrieve topology we are using threadPool and the MDC values are not updated This time for homing-by-vnf-id parallel requests. Issue-ID: VID-253 Change-Id: Ic0be1470445c6fef0e18f9b9d8f1604df508265b Signed-off-by: Ittay Stern --- .../src/main/java/org/onap/vid/utils/Unchecked.java | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'vid-app-common/src/main/java/org/onap/vid/utils/Unchecked.java') diff --git a/vid-app-common/src/main/java/org/onap/vid/utils/Unchecked.java b/vid-app-common/src/main/java/org/onap/vid/utils/Unchecked.java index 23127b61a..9fb15f690 100644 --- a/vid-app-common/src/main/java/org/onap/vid/utils/Unchecked.java +++ b/vid-app-common/src/main/java/org/onap/vid/utils/Unchecked.java @@ -20,10 +20,11 @@ package org.onap.vid.utils; -import org.onap.vid.exceptions.GenericUncheckedException; - import java.net.URI; import java.net.URISyntaxException; +import java.util.function.Supplier; +import org.apache.commons.lang3.exception.ExceptionUtils; +import org.onap.vid.exceptions.GenericUncheckedException; public class Unchecked { private Unchecked() { @@ -39,5 +40,19 @@ public class Unchecked { } } + @FunctionalInterface + public interface UncheckedThrowingSupplier extends Supplier { + + @Override + default T get() { + try { + return getThrows(); + } catch (Exception e) { + return ExceptionUtils.rethrow(e); + } + } + + T getThrows() throws Exception; + } } -- cgit 1.2.3-korg