Created
May 2, 2014 10:24
-
-
Save dgageot/7cc0d1506f5a663918d7 to your computer and use it in GitHub Desktop.
Guice cycle proxies
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
protected void configure() { | |
// ... insert the bindings here | |
binder().disableCircularProxies(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
protected void configure() { | |
// ... insert the bindings here | |
bindListener(Matchers.any(), new TypeListener() { | |
@Override | |
public <I> void hear(TypeLiteral<I> typeLiteral, TypeEncounter<I> typeEncounter) { | |
typeEncounter.register((InjectionListener<I>) bean -> { | |
if (Scopes.isCircularProxy(bean)) { | |
System.out.println(typeLiteral.getRawType().getName()); | |
} | |
}); | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment