Netflix / governator

Governator is a library of extensions and utilities that enhance Google Guice to provide: classpath scanning and automatic binding, lifecycle management, configuration to field mapping, field validation and parallelized object warmup.
Apache License 2.0
825 stars 180 forks source link

Use DefaultResourceConfig instead of PackagesResourceConfig. #325

Closed elandau closed 8 years ago

elandau commented 8 years ago

Classpath scanning can be done with the following @Advises

@Advises
@Singleton
@Named("governator")
UnaryOperator<DefaultResourceConfig> getResourceConfig(Config config) {
    return resourceConfig -> {
        resourceConfig.getClasses().addAll(new PackagesResourceConfig("com.example"));
    };
}