Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for AutoBindSingleton #320

Merged
merged 8 commits into from Sep 26, 2016
Merged

Conversation

elandau
Copy link
Contributor

@elandau elandau commented Sep 1, 2016

Added a general ScanningModuleBuilder with support for class annotations on top of which AutoBindSingleton auto binding is implemented. The resulting module can be installed directly on an injector.

Guice.createInjector(new ScanningModuleBuilder()
     .forPackages("org.example")
     .addScanner(new AutoBindSingletonAnnotatedClassScanner())
     .build()
)

Optimize the scanning module so class path scanning only happens once
@@ -7,6 +7,7 @@ dependencies {
compile "com.google.inject:guice:${guice_version}"
compile "com.google.inject.extensions:guice-multibindings:${guice_version}"
compile "com.google.inject.extensions:guice-grapher:${guice_version}" // should be provided - only if you want graphing
compile "org.ow2.asm:asm:5.0.4"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

asm is fragile since so many things use it; can we use a shaded version, in guice or elsewhere in our dependencies instead?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Change 'default' for AutoBindSingleton value/baseClass to Void (instead of AutoBindSingleton)
Upgrade project to Java8 so we can use Java8's functional interfaces
@elandau elandau merged commit 737990d into Netflix:master Sep 26, 2016
@elandau elandau deleted the feature_abs branch October 14, 2016 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants