Search in sources :

Example 1 with AccessControlClientModule

use of io.joynr.accesscontrol.AccessControlClientModule in project joynr by bmwcarit.

the class ClusterControllerRuntimeModule method configure.

@Override
protected void configure() {
    super.configure();
    install(new LocalCapabilitiesDirectoryModule());
    install(new NoBackendMessagingModule());
    install(new AccessControlClientModule());
    bind(RoutingProvider.class).to(RoutingProviderImpl.class);
    bind(Address.class).annotatedWith(Names.named(GLOBAL_ADDRESS)).toProvider(GlobalAddressProvider.class);
    bind(MessageSender.class).to(CcMessageSender.class);
    bind(MessageRouter.class).to(CcMessageRouter.class).in(Singleton.class);
    ThreadFactory namedThreadFactory = new ThreadFactoryBuilder().setNameFormat("joynr.scheduler.capabilities.freshness-%d").setDaemon(true).build();
    ScheduledExecutorService capabilitiesFreshnessUpdateExecutor = Executors.newSingleThreadScheduledExecutor(namedThreadFactory);
    bind(ScheduledExecutorService.class).annotatedWith(Names.named(LocalCapabilitiesDirectory.JOYNR_SCHEDULER_CAPABILITIES_FRESHNESS)).toInstance(capabilitiesFreshnessUpdateExecutor);
}
Also used : RoutingProvider(joynr.system.RoutingProvider) ThreadFactory(java.util.concurrent.ThreadFactory) NoBackendMessagingModule(io.joynr.messaging.NoBackendMessagingModule) ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService) MessageSender(io.joynr.messaging.sender.MessageSender) CcMessageSender(io.joynr.messaging.sender.CcMessageSender) CcMessageRouter(io.joynr.messaging.routing.CcMessageRouter) ThreadFactoryBuilder(com.google.common.util.concurrent.ThreadFactoryBuilder) AccessControlClientModule(io.joynr.accesscontrol.AccessControlClientModule) LocalCapabilitiesDirectoryModule(io.joynr.capabilities.LocalCapabilitiesDirectoryModule)

Example 2 with AccessControlClientModule

use of io.joynr.accesscontrol.AccessControlClientModule in project joynr by bmwcarit.

the class JeeHttpMessagingModule method configure.

@Override
protected void configure() {
    messagingSkeletonFactory.addBinding(ChannelAddress.class).to(ChannelMessagingSkeleton.class);
    messagingStubFactory.addBinding(ChannelAddress.class).to(ChannelMessagingStubFactory.class);
    Multibinder<GlobalAddressFactory<? extends Address>> globalAddresses;
    globalAddresses = Multibinder.newSetBinder(binder(), new TypeLiteral<GlobalAddressFactory<? extends Address>>() {
    }, Names.named(GlobalAddressProvider.GLOBAL_ADDRESS_PROVIDER));
    globalAddresses.addBinding().to(ServletHttpGlobalAddressFactory.class);
    Multibinder<GlobalAddressFactory<? extends Address>> replyToAddresses;
    replyToAddresses = Multibinder.newSetBinder(binder(), new TypeLiteral<GlobalAddressFactory<? extends Address>>() {
    }, Names.named(ReplyToAddressProvider.REPLY_TO_ADDRESS_PROVIDER));
    replyToAddresses.addBinding().to(ServletHttpGlobalAddressFactory.class);
    install(new AccessControlClientModule());
    bind(RequestConfig.class).toProvider(HttpDefaultRequestConfigProvider.class).in(Singleton.class);
    bind(CloseableHttpClient.class).toProvider(HttpClientProvider.class).in(Singleton.class);
    bind(HttpRequestFactory.class).to(ApacheHttpRequestFactory.class);
    bind(MessageRouter.class).to(CcMessageRouter.class).in(Singleton.class);
    bind(MessageSender.class).to(CcMessageSender.class);
    bind(MessageReceiver.class).to(JeeServletMessageReceiver.class);
    bind(ServletMessageReceiver.class).to(JeeServletMessageReceiver.class);
}
Also used : ChannelAddress(joynr.system.RoutingTypes.ChannelAddress) Address(joynr.system.RoutingTypes.Address) HttpRequestFactory(io.joynr.messaging.http.operation.HttpRequestFactory) ApacheHttpRequestFactory(io.joynr.messaging.http.operation.ApacheHttpRequestFactory) MessageSender(io.joynr.messaging.sender.MessageSender) CcMessageSender(io.joynr.messaging.sender.CcMessageSender) ServletHttpGlobalAddressFactory(io.joynr.messaging.http.ServletHttpGlobalAddressFactory) GlobalAddressFactory(io.joynr.messaging.routing.GlobalAddressFactory) ChannelAddress(joynr.system.RoutingTypes.ChannelAddress) ServletMessageReceiver(io.joynr.dispatcher.ServletMessageReceiver) HttpDefaultRequestConfigProvider(io.joynr.messaging.http.operation.HttpDefaultRequestConfigProvider) TypeLiteral(com.google.inject.TypeLiteral) HttpClientProvider(io.joynr.messaging.http.operation.HttpClientProvider) ServletMessageReceiver(io.joynr.dispatcher.ServletMessageReceiver) MessageReceiver(io.joynr.messaging.MessageReceiver) CcMessageRouter(io.joynr.messaging.routing.CcMessageRouter) AccessControlClientModule(io.joynr.accesscontrol.AccessControlClientModule)

Aggregations

AccessControlClientModule (io.joynr.accesscontrol.AccessControlClientModule)2 CcMessageRouter (io.joynr.messaging.routing.CcMessageRouter)2 CcMessageSender (io.joynr.messaging.sender.CcMessageSender)2 MessageSender (io.joynr.messaging.sender.MessageSender)2 ThreadFactoryBuilder (com.google.common.util.concurrent.ThreadFactoryBuilder)1 TypeLiteral (com.google.inject.TypeLiteral)1 LocalCapabilitiesDirectoryModule (io.joynr.capabilities.LocalCapabilitiesDirectoryModule)1 ServletMessageReceiver (io.joynr.dispatcher.ServletMessageReceiver)1 MessageReceiver (io.joynr.messaging.MessageReceiver)1 NoBackendMessagingModule (io.joynr.messaging.NoBackendMessagingModule)1 ServletHttpGlobalAddressFactory (io.joynr.messaging.http.ServletHttpGlobalAddressFactory)1 ApacheHttpRequestFactory (io.joynr.messaging.http.operation.ApacheHttpRequestFactory)1 HttpClientProvider (io.joynr.messaging.http.operation.HttpClientProvider)1 HttpDefaultRequestConfigProvider (io.joynr.messaging.http.operation.HttpDefaultRequestConfigProvider)1 HttpRequestFactory (io.joynr.messaging.http.operation.HttpRequestFactory)1 GlobalAddressFactory (io.joynr.messaging.routing.GlobalAddressFactory)1 ScheduledExecutorService (java.util.concurrent.ScheduledExecutorService)1 ThreadFactory (java.util.concurrent.ThreadFactory)1 RoutingProvider (joynr.system.RoutingProvider)1 Address (joynr.system.RoutingTypes.Address)1