Created
October 5, 2012 19:32
-
-
Save christophercurrie/3841860 to your computer and use it in GitHub Desktop.
Guice for Dropwizard
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 | |
public ServletContainer getJerseyContainer(DropwizardResourceConfig resourceConfig, | |
MyServiceConfig serviceConfig) { | |
// I like having a root module, but you can use as many as you like | |
final Injector injector = Guice.createInjector(new MyServiceModule(serviceConfig)); | |
return new GuiceContainer(injector) { | |
@Override | |
public ResourceConfig getDefaultResourceConfig(Map<String,Object> props, WebConfig webConfig) { | |
return resourceConfig; | |
} | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nice :)