All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.elastic.sailor.AmqpAwareModule Maven / Gradle / Ivy

There is a newer version: 4.0.3
Show newest version
package io.elastic.sailor;

import com.google.inject.AbstractModule;
import com.google.inject.assistedinject.FactoryModuleBuilder;
import com.google.inject.name.Names;
import io.elastic.api.EventEmitter;
import io.elastic.sailor.impl.*;

public class AmqpAwareModule extends AbstractModule {
    @Override
    protected void configure() {
        bind(AmqpService.class).to(AmqpServiceImpl.class);
        bind(MessageProcessor.class).to(MessageProcessorImpl.class);
        bind(MessagePublisher.class).to(MessagePublisherImpl.class);
        bind(ErrorPublisher.class).to(ErrorPublisherImpl.class);
        bind(MessageResolver.class).to(MessageResolverImpl.class);
        bind(ObjectStorage.class).to(ObjectStorageImpl.class);


        install(new FactoryModuleBuilder()
                .implement(
                        CountingCallback.class,
                        Names.named(Constants.NAME_CALLBACK_DATA),
                        DataCallback.class)
                .implement(
                        CountingCallback.class,
                        Names.named(Constants.NAME_CALLBACK_ERROR),
                        ErrorCallback.class)
                .implement(
                        CountingCallback.class,
                        Names.named(Constants.NAME_CALLBACK_SNAPSHOT),
                        SnapshotCallback.class)
                .implement(
                        CountingCallback.class,
                        Names.named(Constants.NAME_CALLBACK_REBOUND),
                        ReboundCallback.class)
                .implement(
                        EventEmitter.Callback.class,
                        Names.named(Constants.NAME_CALLBACK_UPDATE_KEYS),
                        UpdateKeysCallback.class)
                .implement(
                        EventEmitter.Callback.class,
                        Names.named(Constants.NAME_HTTP_REPLY_KEYS),
                        HttpReplyCallback.class)
                .build(EmitterCallbackFactory.class));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy