From 1b31b75be0dcb9e6439d4812de34d2cb37088587 Mon Sep 17 00:00:00 2001 From: Taylor Wicksell Date: Fri, 19 May 2017 11:54:31 -0700 Subject: [PATCH] check and disable lifecycle features for Spring managed bindings --- .../main/java/com/netflix/governator/LifecycleModule.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/governator-core/src/main/java/com/netflix/governator/LifecycleModule.java b/governator-core/src/main/java/com/netflix/governator/LifecycleModule.java index 806352c7..93c865d8 100644 --- a/governator-core/src/main/java/com/netflix/governator/LifecycleModule.java +++ b/governator-core/src/main/java/com/netflix/governator/LifecycleModule.java @@ -161,6 +161,12 @@ public void onProvision(ProvisionInvocation provision) { return; } + //Ignore for Spring-managed bindings + Object source = provision.getBinding().getSource(); + if(source != null && source.toString().contains("spring-guice")) { + return; + } + final TypeLifecycleActions actions = getOrCreateActions(injectee.getClass()); // Call all postConstructActions for this injectee