Search in sources :

Example 1 with ProxiedRequestsExecutorService

use of org.graylog2.shared.bindings.providers.ProxiedRequestsExecutorService in project graylog2-server by Graylog2.

the class GenericBindings method configure.

@Override
protected void configure() {
    // This is holding all our metrics.
    bind(MetricRegistry.class).toProvider(MetricRegistryProvider.class).asEagerSingleton();
    // must not be a singleton!
    bind(LocalMetricRegistry.class).in(Scopes.NO_SCOPE);
    install(new FactoryModuleBuilder().build(DecodingProcessor.Factory.class));
    bind(ProcessBuffer.class).asEagerSingleton();
    bind(InputBuffer.class).to(InputBufferImpl.class);
    bind(NodeId.class).toProvider(NodeIdProvider.class);
    bind(ServiceManager.class).toProvider(ServiceManagerProvider.class).asEagerSingleton();
    bind(HashedWheelTimer.class).toInstance(new HashedWheelTimer());
    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(OkHttpClient.class).annotatedWith(Names.named("systemHttpClient")).toProvider(SystemOkHttpClientProvider.class).asEagerSingleton();
    bind(MimetypesFileTypeMap.class).toInstance(new MimetypesFileTypeMap());
    bind(ExecutorService.class).annotatedWith(Names.named("proxiedRequestsExecutorService")).toProvider(ProxiedRequestsExecutorService.class).asEagerSingleton();
}
Also used : MimetypesFileTypeMap(javax.activation.MimetypesFileTypeMap) OkHttpClient(okhttp3.OkHttpClient) FactoryModuleBuilder(com.google.inject.assistedinject.FactoryModuleBuilder) MessageInput(org.graylog2.plugin.inputs.MessageInput) HashedWheelTimer(org.jboss.netty.util.HashedWheelTimer) Semaphore(java.util.concurrent.Semaphore) InputRegistry(org.graylog2.shared.inputs.InputRegistry) MetricRegistryProvider(org.graylog2.shared.bindings.providers.MetricRegistryProvider) EventBusProvider(org.graylog2.shared.bindings.providers.EventBusProvider) TypeLiteral(com.google.inject.TypeLiteral) ServiceManagerProvider(org.graylog2.shared.bindings.providers.ServiceManagerProvider) ProxiedRequestsExecutorService(org.graylog2.shared.bindings.providers.ProxiedRequestsExecutorService) IOState(org.graylog2.plugin.IOState) NodeId(org.graylog2.plugin.system.NodeId) SystemOkHttpClientProvider(org.graylog2.shared.bindings.providers.SystemOkHttpClientProvider) OkHttpClientProvider(org.graylog2.shared.bindings.providers.OkHttpClientProvider) ProxiedRequestsExecutorService(org.graylog2.shared.bindings.providers.ProxiedRequestsExecutorService) ExecutorService(java.util.concurrent.ExecutorService) InputBuffer(org.graylog2.plugin.buffers.InputBuffer) SystemOkHttpClientProvider(org.graylog2.shared.bindings.providers.SystemOkHttpClientProvider) ProcessBuffer(org.graylog2.shared.buffers.ProcessBuffer) LocalMetricRegistry(org.graylog2.plugin.LocalMetricRegistry)

Aggregations

TypeLiteral (com.google.inject.TypeLiteral)1 FactoryModuleBuilder (com.google.inject.assistedinject.FactoryModuleBuilder)1 ExecutorService (java.util.concurrent.ExecutorService)1 Semaphore (java.util.concurrent.Semaphore)1 MimetypesFileTypeMap (javax.activation.MimetypesFileTypeMap)1 OkHttpClient (okhttp3.OkHttpClient)1 IOState (org.graylog2.plugin.IOState)1 LocalMetricRegistry (org.graylog2.plugin.LocalMetricRegistry)1 InputBuffer (org.graylog2.plugin.buffers.InputBuffer)1 MessageInput (org.graylog2.plugin.inputs.MessageInput)1 NodeId (org.graylog2.plugin.system.NodeId)1 EventBusProvider (org.graylog2.shared.bindings.providers.EventBusProvider)1 MetricRegistryProvider (org.graylog2.shared.bindings.providers.MetricRegistryProvider)1 OkHttpClientProvider (org.graylog2.shared.bindings.providers.OkHttpClientProvider)1 ProxiedRequestsExecutorService (org.graylog2.shared.bindings.providers.ProxiedRequestsExecutorService)1 ServiceManagerProvider (org.graylog2.shared.bindings.providers.ServiceManagerProvider)1 SystemOkHttpClientProvider (org.graylog2.shared.bindings.providers.SystemOkHttpClientProvider)1 ProcessBuffer (org.graylog2.shared.buffers.ProcessBuffer)1 InputRegistry (org.graylog2.shared.inputs.InputRegistry)1 HashedWheelTimer (org.jboss.netty.util.HashedWheelTimer)1