Refine search
@Override protected void configure() { bind(MongoClientService.class).asEagerSingleton(); } }
@Override protected void configure() { bind(River.class).to(MongoDBRiver.class).asEagerSingleton(); }
@Override protected void configure() { bind(RepositoriesService.class).toInstance(repositoriesService); bind(SnapshotsService.class).asEagerSingleton(); bind(SnapshotShardsService.class).asEagerSingleton(); bind(TransportNodesSnapshotsStatus.class).asEagerSingleton(); bind(RestoreService.class).asEagerSingleton(); } }
@Override protected void configure() { bind(ActionFilters.class).toInstance(actionFilters); bind(DestructiveOperations.class).toInstance(destructiveOperations); if (false == transportClient) { // Supporting classes only used when not a transport client bind(AutoCreateIndex.class).toInstance(autoCreateIndex); bind(TransportLivenessAction.class).asEagerSingleton(); // register GenericAction -> transportAction Map used by NodeClient @SuppressWarnings("rawtypes") MapBinder<GenericAction, TransportAction> transportActionsBinder = MapBinder.newMapBinder(binder(), GenericAction.class, TransportAction.class); for (ActionHandler<?, ?> action : actions.values()) { // bind the action as eager singleton, so the map binder one will reuse it bind(action.getTransportAction()).asEagerSingleton(); transportActionsBinder.addBinding(action.getAction()).to(action.getTransportAction()).asEagerSingleton(); for (Class<?> supportAction : action.getSupportTransportActions()) { bind(supportAction).asEagerSingleton(); } } } }
@Override protected void configure() { bind(HttpServerTransport.class).to(JettyHttpServerTransport.class).asEagerSingleton(); bind(ESLoggerWrapper.class).asEagerSingleton(); } }
@Override protected void configure() { bind(DirectoryService.class).to(shardDirectory).asEagerSingleton(); bind(Store.class).asEagerSingleton(); bind(ShardLock.class).toInstance(lock); bind(Store.OnClose.class).toInstance(closeCallback); bind(ShardPath.class).toInstance(path); } }
@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(TransportExportAction.class).asEagerSingleton(); bind(ExportParser.class).asEagerSingleton(); bind(Exporter.class).asEagerSingleton(); MapBinder<GenericAction, TransportAction> transportActionsBinder = MapBinder.newMapBinder(binder(), GenericAction.class, TransportAction.class); transportActionsBinder.addBinding(ExportAction.INSTANCE).to(TransportExportAction.class).asEagerSingleton(); MapBinder<String, GenericAction> actionsBinder = MapBinder.newMapBinder(binder(), String.class, GenericAction.class); actionsBinder.addBinding(ExportAction.NAME).toInstance(ExportAction.INSTANCE); } }
@Override protected void configure() { bind(IndexDeletionPolicy.class) .annotatedWith(Names.named("actual")) .to(KeepOnlyLastDeletionPolicy.class) .asEagerSingleton(); bind(SnapshotDeletionPolicy.class) .asEagerSingleton(); } }
@Override public void configure(Binder binder) { binder.bind(Settings.class).toInstance(settings); binder.bind(SettingsFilter.class).toInstance(settingsFilter); binder.bind(ClusterSettings.class).toInstance(clusterSettings); binder.bind(IndexScopedSettings.class).toInstance(indexScopedSettings); }
httpServerTransport = networkModule.getHttpServerTransportSupplier().get(); httpBind = b -> { b.bind(HttpServerTransport.class).toInstance(httpServerTransport); }; } else { httpBind = b -> { b.bind(HttpServerTransport.class).toProvider(Providers.of(null)); }; httpServerTransport = null; b.bind(Node.class).toInstance(this); b.bind(NodeService.class).toInstance(nodeService); b.bind(NamedXContentRegistry.class).toInstance(xContentRegistry); b.bind(PluginsService.class).toInstance(pluginsService); b.bind(Client.class).toInstance(client); b.bind(NodeClient.class).toInstance(client); b.bind(Environment.class).toInstance(this.environment); b.bind(ThreadPool.class).toInstance(threadPool); b.bind(NodeEnvironment.class).toInstance(nodeEnvironment); b.bind(ResourceWatcherService.class).toInstance(resourceWatcherService); b.bind(CircuitBreakerService.class).toInstance(circuitBreakerService); b.bind(BigArrays.class).toInstance(bigArrays); b.bind(PageCacheRecycler.class).toInstance(pageCacheRecycler); b.bind(ScriptService.class).toInstance(scriptModule.getScriptService()); b.bind(AnalysisRegistry.class).toInstance(analysisModule.getAnalysisRegistry()); b.bind(IngestService.class).toInstance(ingestService); b.bind(UsageService.class).toInstance(usageService); b.bind(NamedWriteableRegistry.class).toInstance(namedWriteableRegistry); b.bind(MetaDataUpgrader.class).toInstance(metaDataUpgrader);
@Override protected void configure() { bind(String.class).annotatedWith(LocalNodeId.class).toInstance(localNodeId); } }
@Override protected void configure() { bind(ZMQRestImpl.class).asEagerSingleton(); bind(ZMQServerTransport.class).to(ZMQQueueServerImpl.class).asEagerSingleton(); bind(ZMQServer.class).asEagerSingleton(); } }
@Override protected void configure() { if (pageCacheRecyclerImpl == PageCacheRecycler.class) { bind(PageCacheRecycler.class).asEagerSingleton(); } else { bind(PageCacheRecycler.class).to(pageCacheRecyclerImpl).asEagerSingleton(); } if (bigArraysImpl == BigArrays.class) { bind(BigArrays.class).asEagerSingleton(); } else { bind(BigArrays.class).to(bigArraysImpl).asEagerSingleton(); } bind(Node.class).toInstance(node); bind(NodeSettingsService.class).asEagerSingleton(); bind(NodeService.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(TransportImportAction.class).asEagerSingleton(); bind(ImportParser.class).asEagerSingleton(); bind(Importer.class).asEagerSingleton(); MapBinder<GenericAction, TransportAction> transportActionsBinder = MapBinder.newMapBinder(binder(), GenericAction.class, TransportAction.class); transportActionsBinder.addBinding(ImportAction.INSTANCE).to(TransportImportAction.class).asEagerSingleton(); MapBinder<String, GenericAction> actionsBinder = MapBinder.newMapBinder(binder(), String.class, GenericAction.class); actionsBinder.addBinding(ImportAction.NAME).toInstance(ImportAction.INSTANCE); }
@Override protected void configure() { bind(ActionFilters.class).toInstance(actionFilters); bind(DestructiveOperations.class).toInstance(destructiveOperations); if (false == transportClient) { // Supporting classes only used when not a transport client bind(AutoCreateIndex.class).toInstance(autoCreateIndex); bind(TransportLivenessAction.class).asEagerSingleton(); // register GenericAction -> transportAction Map used by NodeClient @SuppressWarnings("rawtypes") MapBinder<GenericAction, TransportAction> transportActionsBinder = MapBinder.newMapBinder(binder(), GenericAction.class, TransportAction.class); for (ActionHandler<?, ?> action : actions.values()) { // bind the action as eager singleton, so the map binder one will reuse it bind(action.getTransportAction()).asEagerSingleton(); transportActionsBinder.addBinding(action.getAction()).to(action.getTransportAction()).asEagerSingleton(); for (Class<?> supportAction : action.getSupportTransportActions()) { bind(supportAction).asEagerSingleton(); } } } }
@Override public void configure(Binder binder) { binder = binder.withSource(SourceProvider.UNKNOWN_SOURCE); binder.bind(Stage.class).toInstance(stage); binder.bindScope(Singleton.class, SINGLETON); } }
@Override protected void configure() { bind(Discovery.class).to(FabricDiscovery.class).asEagerSingleton(); } }
@SuppressWarnings({"unchecked"}) @Override protected void configure() { bind(HttpServerTransport.class).to(httpServerTransportClass).asEagerSingleton(); bind(HttpServer.class).asEagerSingleton(); }