Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Clone this wiki locally
@AutoBindSingleton is deprecated in favor of using bindings in Guice modules. @AutoBindSingleton has been the source of numerous problems since it frequently results in unwanted classes being instantiated. Furthermore, @AutoBindSingleton is misleading since it is not a proper Guice scope. For example, any @AutoBindSingleton annotated class that does not also have the @Singleton annotation does not exhibit singleton behavior when that class was not pulled in via classpath scanning.
Using Guice’s modules to add bindings can be cumbersome and tedious. It’s also unnecessary for most simple types of binding. Governator can scan your CLASSPATH to do “auto binding”. There are two types of auto binding supported:
Governator will only scan configured packages from the CLASSPATH. Set the packages to use with the
usingBasePackages() method of the