use of org.graylog2.indexer.IndexTemplateProvider in project graylog2-server by Graylog2.
the class GenericBindings method configure.
@Override
protected void configure() {
// must not be a singleton!
bind(LocalMetricRegistry.class).in(Scopes.NO_SCOPE);
install(new FactoryModuleBuilder().build(DecodingProcessor.Factory.class));
bind(ProcessBuffer.class).asEagerSingleton();
if (isMigrationCommand) {
bind(InputBuffer.class).to(NoopInputBuffer.class);
} else {
bind(InputBuffer.class).to(InputBufferImpl.class);
}
bind(NodeId.class).toProvider(NodeIdProvider.class);
if (!isMigrationCommand) {
bind(ServiceManager.class).toProvider(ServiceManagerProvider.class).asEagerSingleton();
}
bind(ThroughputCounter.class);
bind(EventBus.class).toProvider(EventBusProvider.class).in(Scopes.SINGLETON);
bind(Semaphore.class).annotatedWith(Names.named("JournalSignal")).toInstance(new Semaphore(0));
install(new FactoryModuleBuilder().build(new TypeLiteral<IOState.Factory<MessageInput>>() {
}));
bind(InputRegistry.class).asEagerSingleton();
bind(OkHttpClient.class).toProvider(OkHttpClientProvider.class).asEagerSingleton();
bind(MimetypesFileTypeMap.class).toInstance(new MimetypesFileTypeMap());
bind(ExecutorService.class).annotatedWith(Names.named("proxiedRequestsExecutorService")).toProvider(ProxiedRequestsExecutorService.class).asEagerSingleton();
bind(FailureHandler.class).annotatedWith(Names.named("fallbackFailureHandler")).to(DefaultFailureHandler.class).asEagerSingleton();
Multibinder.newSetBinder(binder(), FailureHandler.class);
OptionalBinder.newOptionalBinder(binder(), FailureHandlingConfiguration.class).setDefault().to(DefaultFailureHandlingConfiguration.class);
final MapBinder<String, IndexTemplateProvider> indexTemplateProviderBinder = MapBinder.newMapBinder(binder(), String.class, IndexTemplateProvider.class);
indexTemplateProviderBinder.addBinding(MessageIndexTemplateProvider.MESSAGE_TEMPLATE_TYPE).to(MessageIndexTemplateProvider.class);
indexTemplateProviderBinder.addBinding(EventIndexTemplateProvider.EVENT_TEMPLATE_TYPE).to(EventIndexTemplateProvider.class);
serviceBinder().addBinding().to(FailureHandlingService.class).in(Scopes.SINGLETON);
}
Aggregations