use of com.twitter.common.application.modules.HttpModule in project commons by twitter.
the class Main method getModules.
@Override
public Iterable<? extends Module> getModules() {
return Arrays.asList(new HttpModule(), new LogModule(), new StatsModule(), new AbstractModule() {
@Override
protected void configure() {
bind(new TypeLiteral<Closure<String>>() {
}).toInstance(new Closure<String>() {
private final Client http = Client.create();
@Override
public void execute(String path) {
http.asyncResource("http://" + PING_TARGET.get() + path).get(String.class);
}
});
install(new JerseyServletModule() {
@Override
protected void configureServlets() {
filter("/ping*").through(GuiceContainer.class, ImmutableMap.<String, String>of());
Registration.registerEndpoint(binder(), "/ping");
bind(PingHandler.class);
}
});
}
});
}
Aggregations