From decbd10b9f60b7a59ff01a6102802a1ba58bc07d Mon Sep 17 00:00:00 2001 From: Andrus Adamchik Date: Wed, 6 Dec 2023 18:53:19 -0500 Subject: [PATCH] updating ShutdownManager calls after bootique/bootique#346 --- .../src/main/java/io/bootique/cxf/BusProvider.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/bootique-cxf-core/src/main/java/io/bootique/cxf/BusProvider.java b/bootique-cxf-core/src/main/java/io/bootique/cxf/BusProvider.java index f7e0b98..0e55f78 100644 --- a/bootique-cxf-core/src/main/java/io/bootique/cxf/BusProvider.java +++ b/bootique-cxf-core/src/main/java/io/bootique/cxf/BusProvider.java @@ -15,9 +15,9 @@ import org.apache.cxf.interceptor.Interceptor; import org.apache.cxf.message.Message; -import java.util.Set; import javax.inject.Inject; import javax.inject.Provider; +import java.util.Set; public class BusProvider implements Provider { @@ -56,7 +56,6 @@ public BusProvider( public Bus get() { ExtensionManagerBus bus = new ExtensionManagerBus(); - ConfiguredBeanLocator originalLocator = bus.getExtension(ConfiguredBeanLocator.class); MultisourceBeanLocator multisourceBeanLocator = new MultisourceBeanLocator(beanLocator, originalLocator); @@ -75,9 +74,6 @@ public Bus get() { BusFactory.possiblySetDefaultBus(bus); - shutdownManager.addShutdownHook(bus::shutdown); - - - return bus; + return shutdownManager.onShutdown(bus, b -> b.shutdown()); } }