use of io.joynr.capabilities.StaticCapabilitiesProvisioningModule in project joynr by bmwcarit.
the class AbstractRuntimeModule method configure.
@Override
protected void configure() {
requestStaticInjection(CapabilityUtils.class, RpcUtils.class, ArbitratorFactory.class, JoynrDelayMessageException.class, JoynrAppenderManagerFactory.class);
install(new JsonMessageSerializerModule());
install(new FactoryModuleBuilder().implement(ProxyInvocationHandler.class, ProxyInvocationHandlerImpl.class).build(ProxyInvocationHandlerFactory.class));
install(new JoynrMessageScopeModule());
messagingStubFactory = MapBinder.newMapBinder(binder(), new TypeLiteral<Class<? extends Address>>() {
}, new TypeLiteral<AbstractMiddlewareMessagingStubFactory<? extends IMessagingStub, ? extends Address>>() {
}, Names.named(MessagingStubFactory.MIDDLEWARE_MESSAGING_STUB_FACTORIES));
messagingStubFactory.addBinding(InProcessAddress.class).to(InProcessMessagingStubFactory.class);
messagingSkeletonFactory = MapBinder.newMapBinder(binder(), new TypeLiteral<Class<? extends Address>>() {
}, new TypeLiteral<IMessagingSkeleton>() {
}, Names.named(MessagingSkeletonFactory.MIDDLEWARE_MESSAGING_SKELETONS));
messagingSkeletonFactory.addBinding(InProcessAddress.class).to(InProcessLibjoynrMessagingSkeleton.class);
// other address types must be added to the Multibinder to support global addressing. Created here to make
// sure the Set exists, even if empty.
Multibinder.newSetBinder(binder(), new TypeLiteral<GlobalAddressFactory<? extends Address>>() {
}, Names.named(GlobalAddressProvider.GLOBAL_ADDRESS_PROVIDER));
Multibinder.newSetBinder(binder(), new TypeLiteral<GlobalAddressFactory<? extends Address>>() {
}, Names.named(ReplyToAddressProvider.REPLY_TO_ADDRESS_PROVIDER));
multicastAddressCalculators = Multibinder.newSetBinder(binder(), new TypeLiteral<MulticastAddressCalculator>() {
});
bind(ProxyBuilderFactory.class).to(ProxyBuilderFactoryImpl.class);
bind(RequestReplyManager.class).to(RequestReplyManagerImpl.class);
bind(SubscriptionManager.class).to(SubscriptionManagerImpl.class);
bind(PublicationManager.class).to(PublicationManagerImpl.class);
bind(Dispatcher.class).to(DispatcherImpl.class);
bind(LocalDiscoveryAggregator.class).in(Singleton.class);
bind(DiscoveryAsync.class).to(LocalDiscoveryAggregator.class);
bind(CapabilitiesRegistrar.class).to(CapabilitiesRegistrarImpl.class);
bind(ParticipantIdStorage.class).to(PropertiesFileParticipantIdStorage.class);
bind(SubscriptionRequestStorage.class).to(FileSubscriptionRequestStorage.class);
bind(MessagingSettings.class).to(ConfigurableMessagingSettings.class);
bind(RoutingTable.class).to(RoutingTableImpl.class).asEagerSingleton();
bind(MulticastReceiverRegistry.class).to(InMemoryMulticastReceiverRegistry.class).asEagerSingleton();
bind(RawMessagingPreprocessor.class).to(NoOpRawMessagingPreprocessor.class);
bind(ScheduledExecutorService.class).annotatedWith(Names.named(MessageRouter.SCHEDULEDTHREADPOOL)).toProvider(DefaultScheduledExecutorServiceProvider.class);
bind(StatusReceiver.class).to(DefaultStatusReceiver.class);
install(new StaticCapabilitiesProvisioningModule());
bind(ScheduledExecutorService.class).annotatedWith(Names.named(JOYNR_SCHEDULER_CLEANUP)).toProvider(DefaultScheduledExecutorServiceProvider.class);
Multibinder.newSetBinder(binder(), new TypeLiteral<JoynrMessageProcessor>() {
});
}
Aggregations