// Bindings required for the leader redirector.
requireBinding(LocalServiceRegistry.class);
requireBinding(Key.get(new TypeLiteral<DynamicHostSet<ServiceInstance>>() { }));
Registration.registerServletFilter(binder(), GuiceFilter.class, "/*");
install(new JerseyServletModule() {
private void registerJerseyEndpoint(String indexPath, Class<?>... servlets) {
filter(indexPath + "*").through(LeaderRedirectFilter.class);
filter(indexPath + "*").through(GuiceContainer.class, CONTAINER_PARAMS);
Registration.registerEndpoint(binder(), indexPath);
for (Class<?> servlet : servlets) {