@Override protected void configure() { bind(String.class).annotatedWith(LocalNodeId.class).toInstance(localNodeId); } }
@Override protected void configure() { bind(String.class).annotatedWith(Names.named("appName")).toInstance("elasticshell"); bind(InputStream.class).annotatedWith(Names.named("shellInput")).toInstance(System.in); bind(PrintStream.class).annotatedWith(Names.named("shellOutput")).toInstance(new PrintStream(System.out, true)); bind(ShutdownHook.class).asEagerSingleton(); bind(ResourceRegistry.class).to(DefaultResourceRegistry.class).asEagerSingleton(); bind(Scheduler.class).to(DefaultScheduler.class).asEagerSingleton(); } }
@Override protected void configure() { bind(IndexDeletionPolicy.class) .annotatedWith(Names.named("actual")) .to(KeepOnlyLastDeletionPolicy.class) .asEagerSingleton(); bind(SnapshotDeletionPolicy.class) .asEagerSingleton(); } }
@Override protected void configure() { bind(HttpServerTransport.class) .to(FilterHttpServerTransport.class).asEagerSingleton(); Class<? extends HttpServerTransport> transport; // This is a hack for debugging. It allows switching back to NettyHttpServer if needed. // HttpServerTransportModule should be loaded instead of just binding HttpServerTransport // directly. Unfortunately, it's not possible to override annotation then. transport = componentSettings.getAsClass("transport_type", JettyHttpServerTransport.class, "org.elasticsearch.http.", "HttpServerTransport"); bind(HttpServerTransport.class) .annotatedWith(FilteredHttpServerTransport.class) .to(transport).asEagerSingleton(); bind(ESLoggerWrapper.class).asEagerSingleton(); configureFilters(); }
@Override protected void configure() { bind(DynamicSettings.class).annotatedWith(ClusterDynamicSettings.class).toInstance(clusterDynamicSettings.build()); bind(DynamicSettings.class).annotatedWith(IndexDynamicSettings.class).toInstance(indexDynamicSettings.build());