com.google.inject.multibindings.Multibinder Java Examples
The following examples show how to use
com.google.inject.multibindings.Multibinder.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MessagesModule.java From arcusplatform with Apache License 2.0 | 7 votes |
@Override protected void configure() { Multibinder<TypeAdapterFactory> typeAdapterFactoryBinder = Multibinder.newSetBinder(binder(), new TypeLiteral<TypeAdapterFactory>() {}); typeAdapterFactoryBinder.addBinding().to(AddressTypeAdapterFactory.class); typeAdapterFactoryBinder.addBinding().to(GsonReferenceTypeAdapterFactory.class); typeAdapterFactoryBinder.addBinding().to(MessageTypeAdapterFactory.class); typeAdapterFactoryBinder.addBinding().to(MessageBodyTypeAdapterFactory.class); Multibinder<TypeAdapter<?>> typeAdapterBinder = Multibinder.newSetBinder(binder(), new TypeLiteral<TypeAdapter<?>>() {}); typeAdapterBinder.addBinding().to(ProtocolDeviceIdTypeAdapter.class); typeAdapterBinder.addBinding().to(HubMessageTypeAdapter.class); Multibinder<JsonSerializer<?>> serializerBinder = Multibinder.newSetBinder(binder(), new TypeLiteral<JsonSerializer<?>>() {}); serializerBinder.addBinding().to(ClientMessageTypeAdapter.class); serializerBinder.addBinding().to(ResultTypeAdapter.class); Multibinder<JsonDeserializer<?>> deserializerBinder = Multibinder.newSetBinder(binder(), new TypeLiteral<JsonDeserializer<?>>() {}); deserializerBinder.addBinding().to(ClientMessageTypeAdapter.class); deserializerBinder.addBinding().to(ResultTypeAdapter.class); }
Example #2
Source File: VideoPreviewServerModule.java From arcusplatform with Apache License 2.0 | 6 votes |
@Override protected void configure() { bind(BridgeServerConfig.class); bind(PreviewConfig.class); bind(BridgeServerTlsContext.class).to(BridgeServerTlsContextImpl.class); bind(BridgeServerTrustManagerFactory.class).to(NullTrustManagerFactoryImpl.class); bind(ChannelInboundHandler.class).toProvider(BaseWebSocketServerHandlerProvider.class); bind(new TypeLiteral<ChannelInitializer<SocketChannel>>(){}).to(HttpRequestInitializer.class); bind(Authenticator.class).to(ShiroAuthenticator.class); bind(SessionFactory.class).to(DefaultSessionFactoryImpl.class); bind(SessionRegistry.class).to(DefaultSessionRegistryImpl.class); bind(RequestMatcher.class).annotatedWith(Names.named("WebSocketUpgradeMatcher")).to(NeverMatcher.class); bind(RequestAuthorizer.class).annotatedWith(Names.named("SessionAuthorizer")).to(SessionAuth.class); bind(IrisNettyAuthorizationContextLoader.class).to(SubscriberAuthorizationContextLoader.class); // No Session Listeners Multibinder<SessionListener> slBindings = Multibinder.newSetBinder(binder(), SessionListener.class); // Bind Http Handlers Multibinder<RequestHandler> rhBindings = Multibinder.newSetBinder(binder(), RequestHandler.class); rhBindings.addBinding().to(RootRedirect.class); rhBindings.addBinding().to(IndexPage.class); rhBindings.addBinding().to(CheckPage.class); rhBindings.addBinding().to(PreviewHandler.class); }
Example #3
Source File: IvrFallbackServerModule.java From arcusplatform with Apache License 2.0 | 6 votes |
@Override protected void configure() { // No Session Listeners Multibinder<SessionListener> slBindings = Multibinder.newSetBinder(binder(), SessionListener.class); // Bind Http Handlers Multibinder<RequestHandler> rhBindings = Multibinder.newSetBinder(binder(), RequestHandler.class); rhBindings.addBinding().to(RootRedirect.class); rhBindings.addBinding().to(CheckPage.class); rhBindings.addBinding().to(IndexPage.class); rhBindings.addBinding().to(TwilioFallbackHandler.class); rhBindings.addBinding().to(TwilioRequestHandler.class); // TODO why isn't this part of the NoAuthModule... bind(RequestAuthorizer.class) .annotatedWith(Names.named("SessionAuthorizer")) .to(AlwaysAllow.class); // use the BaseHandler because it isn't abstract as the name implies, its just doesn't fully support websockets bind(ChannelInboundHandler.class).toProvider(BaseWebSocketServerHandlerProvider.class); // TODO bind this up into a WebSocket / NoWebSocket module... bind(RequestMatcher.class).annotatedWith(Names.named("WebSocketUpgradeMatcher")).to(NeverMatcher.class); }
Example #4
Source File: BillingServerModule.java From arcusplatform with Apache License 2.0 | 6 votes |
@Override protected void configure() { // No Session Listeners Multibinder<SessionListener> slBindings = Multibinder.newSetBinder(binder(), SessionListener.class); // Bind Http Handlers Multibinder<RequestHandler> rhBindings = Multibinder.newSetBinder(binder(), RequestHandler.class); rhBindings.addBinding().to(RootRedirect.class); rhBindings.addBinding().to(IndexPage.class); rhBindings.addBinding().to(CheckPage.class); rhBindings.addBinding().to(RecurlyCallbackHttpHandler.class); bind(RequestAuthorizer.class) .annotatedWith(Names.named("SessionAuthorizer")) .to(AlwaysAllow.class); MapBinder<String,WebhookHandler<? extends Object>> actionBinder = MapBinder.newMapBinder(binder(),new TypeLiteral<String>(){},new TypeLiteral<WebhookHandler<? extends Object>>(){}); actionBinder.addBinding(RecurlyCallbackHttpHandler.TRANS_TYPE_CLOSED_INVOICE_NOTIFICATION).to(ClosedInvoiceWebhookHandler.class); // use the BaseHandler because it isn't abstract as the name implies, its just doesn't fully support websockets bind(ChannelInboundHandler.class).toProvider(BaseWebSocketServerHandlerProvider.class); // TODO bind this up into a WebSocket / NoWebSocket module... bind(RequestMatcher.class).annotatedWith(Names.named("WebSocketUpgradeMatcher")).to(NeverMatcher.class); }
Example #5
Source File: IvrServerModule.java From arcusplatform with Apache License 2.0 | 6 votes |
@Override protected void configure() { // No Session Listeners Multibinder<SessionListener> slBindings = Multibinder.newSetBinder(binder(), SessionListener.class); // Bind Http Handlers Multibinder<RequestHandler> rhBindings = Multibinder.newSetBinder(binder(), RequestHandler.class); rhBindings.addBinding().to(RootRedirect.class); rhBindings.addBinding().to(IndexPage.class); rhBindings.addBinding().to(CheckPage.class); rhBindings.addBinding().to(TwilioAckScriptHandler.class); rhBindings.addBinding().to(TwilioAckEventHandler.class); bind(NotificationAuditor.class).to(CassandraAuditor.class); // TODO why isn't this part of the NoAuthModule... bind(RequestAuthorizer.class) .annotatedWith(Names.named("SessionAuthorizer")) .to(AlwaysAllow.class); // use the BaseHandler because it isn't abstract as the name implies, its just doesn't fully support websockets bind(ChannelInboundHandler.class).toProvider(BaseWebSocketServerHandlerProvider.class); // TODO bind this up into a WebSocket / NoWebSocket module... bind(RequestMatcher.class).annotatedWith(Names.named("WebSocketUpgradeMatcher")).to(NeverMatcher.class); }
Example #6
Source File: PersonServiceModule.java From arcusplatform with Apache License 2.0 | 6 votes |
@Override protected void configure() { Multibinder<ContextualRequestMessageHandler<Person>> handlerBinder = bindSetOf(new TypeLiteral<ContextualRequestMessageHandler<Person>>() {}); handlerBinder.addBinding().to(PersonGetAttributesHandler.class); handlerBinder.addBinding().to(PersonSetAttributesHandler.class); handlerBinder.addBinding().to(SetSecurityAnswersHandler.class); handlerBinder.addBinding().to(GetSecurityAnswersHandler.class); handlerBinder.addBinding().to(AddMobileDeviceHandler.class); handlerBinder.addBinding().to(RemoveMobileDeviceHandler.class); handlerBinder.addBinding().to(ListMobileDevicesHandler.class); handlerBinder.addBinding().to(PersonDeleteHandler.class); handlerBinder.addBinding().to(ListHistoryEntriesHandler.class); handlerBinder.addBinding().to(AcceptInvitationHandler.class); handlerBinder.addBinding().to(RejectInvitationHandler.class); handlerBinder.addBinding().to(PendingInvitationsHandler.class); handlerBinder.addBinding().to(PersonRemoveFromPlaceHandler.class); handlerBinder.addBinding().to(PromoteToAccountHandler.class); handlerBinder.addBinding().to(DeleteLoginHandler.class); handlerBinder.addBinding().to(ListAvailablePlacesHandler.class); handlerBinder.addBinding().to(AcceptPolicyHandler.class); handlerBinder.addBinding().to(RejectPolicyHandler.class); bindSetOf(PlatformService.class).addBinding().to(PersonService.class); }
Example #7
Source File: DriverModule.java From arcusplatform with Apache License 2.0 | 6 votes |
@Override protected void configure() { bind(DriverService.class).to(PlatformDriverService.class).asEagerSingleton(); Multibinder<DriverServiceRequestHandler> handlers = bindSetOf(DriverServiceRequestHandler.class); handlers.addBinding().to(UpgradeDriverRequestHandler.class); handlers.addBinding().to(RemoveRequestHandler.class); handlers.addBinding().to(ForceRemoveRequestHandler.class); handlers.addBinding().to(LostRequestHandler.class); handlers.addBinding().to(MessageHandler.class); handlers.addBinding().to(ListHistoryEntriesHandler.class); bind(DeviceInitializer.class) .to(DefaultNameInitializer.class); bind(DriverExecutorRegistry.class).to(PlatformDriverExecutorRegistry.class); }
Example #8
Source File: HubServiceModule.java From arcusplatform with Apache License 2.0 | 6 votes |
@Override protected void configure() { bind(HubHeartbeatListener.class).asEagerSingleton(); bind(HubEventListener.class).asEagerSingleton(); bind(OfflineHubRequestHandler.class).asEagerSingleton(); Multibinder<ContextualRequestMessageHandler<Hub>> handlerBinder = bindSetOf(new TypeLiteral<ContextualRequestMessageHandler<Hub>>() {}); handlerBinder.addBinding().to(HubGetAttributesHandler.class); handlerBinder.addBinding().to(FirmwareUpdateProgressMessageHandler.class); handlerBinder.addBinding().to(HubDeleteHandler.class); Multibinder<ContextualEventMessageHandler<Place>> placeEventBinder = bindSetOf(new TypeLiteral<ContextualEventMessageHandler<Place>>() {}); placeEventBinder.addBinding().to(PlaceValueChangeListener.class); Multibinder<ContextualEventMessageHandler<Hub>> eventBinder = bindSetOf(new TypeLiteral<ContextualEventMessageHandler<Hub>>() {}); eventBinder.addBinding().to(PlaceDeletedListener.class); Multibinder<PlatformService> services = bindSetOf(PlatformService.class); services.addBinding().to(HubService.class); services.addBinding().to(HubHeartbeatListener.class); services.addBinding().to(HubEventListener.class); }
Example #9
Source File: TagServiceModule.java From arcusplatform with Apache License 2.0 | 6 votes |
@Override protected void configure() { Multibinder<Object> handlers = newSetBinder(binder(), Object.class, Names.named(PROP_HANDLERS)); handlers.addBinding().to(TaggedEventHandler.class); bind(TagServiceListener.class).asEagerSingleton(); // tag-service doesn't use any DAO functionality, so this binding is just to avoid Guice startup exceptions bind(ResourceBundleDAO.class).to(EmptyResourceBundle.class); executor = new ThreadPoolBuilder() .withBlockingBacklog() .withMaxPoolSize(config.getThreads()) .withKeepAliveMs(config.getKeepAliveMs()) .withNameFormat("tag-%d") .withMetrics("tag") .build(); }
Example #10
Source File: AlexaServerModule.java From arcusplatform with Apache License 2.0 | 6 votes |
@Override protected void configure() { bind(Address.class).annotatedWith(Names.named(VoiceBridgeConfig.NAME_BRIDGEADDRESS)).toInstance(AlexaUtil.ADDRESS_BRIDGE); bind(String.class).annotatedWith(Names.named(VoiceBridgeConfig.NAME_BRIDGEASSISTANT)).toInstance(VoiceService.StartPlaceRequest.ASSISTANT_ALEXA); bind(AlexaPlatformService.class).asEagerSingleton(); Multibinder<SmartHomeSkillHandler> handlers = Multibinder.newSetBinder(binder(), SmartHomeSkillHandler.class); handlers.addBinding().to(SmartHomeSkillV2Handler.class); handlers.addBinding().to(SmartHomeSkillV3Handler.class); // Bind Http Handlers Multibinder<RequestHandler> rhBindings = Multibinder.newSetBinder(binder(), RequestHandler.class); rhBindings.addBinding().to(SmartHomeSkillRequestHandler.class); VoiceBridgeMetrics metrics = new VoiceBridgeMetrics("alexa-bridge","alexa.bridge", "directive"); bind(BridgeMetrics.class).toInstance(metrics); bind(VoiceBridgeMetrics.class).toInstance(metrics); }
Example #11
Source File: KuduModule.java From presto with Apache License 2.0 | 6 votes |
@Override protected void configure() { bind(TypeManager.class).toInstance(typeManager); bind(KuduConnector.class).in(Scopes.SINGLETON); bind(KuduMetadata.class).in(Scopes.SINGLETON); bind(KuduTableProperties.class).in(Scopes.SINGLETON); bind(ConnectorSplitManager.class).to(KuduSplitManager.class).in(Scopes.SINGLETON); bind(ConnectorPageSourceProvider.class).to(KuduPageSourceProvider.class) .in(Scopes.SINGLETON); bind(ConnectorPageSinkProvider.class).to(KuduPageSinkProvider.class).in(Scopes.SINGLETON); bind(KuduHandleResolver.class).in(Scopes.SINGLETON); bind(KuduRecordSetProvider.class).in(Scopes.SINGLETON); configBinder(binder()).bindConfig(KuduClientConfig.class); bind(RangePartitionProcedures.class).in(Scopes.SINGLETON); Multibinder.newSetBinder(binder(), Procedure.class); }
Example #12
Source File: RaptorModule.java From presto with Apache License 2.0 | 6 votes |
@Override public void configure(Binder binder) { binder.bind(RaptorConnectorId.class).toInstance(new RaptorConnectorId(connectorId)); binder.bind(RaptorConnector.class).in(Scopes.SINGLETON); binder.bind(RaptorMetadataFactory.class).in(Scopes.SINGLETON); binder.bind(RaptorSplitManager.class).in(Scopes.SINGLETON); binder.bind(RaptorPageSourceProvider.class).in(Scopes.SINGLETON); binder.bind(RaptorPageSinkProvider.class).in(Scopes.SINGLETON); binder.bind(RaptorHandleResolver.class).in(Scopes.SINGLETON); binder.bind(RaptorNodePartitioningProvider.class).in(Scopes.SINGLETON); binder.bind(RaptorSessionProperties.class).in(Scopes.SINGLETON); binder.bind(RaptorTableProperties.class).in(Scopes.SINGLETON); Multibinder<SystemTable> tableBinder = newSetBinder(binder, SystemTable.class); tableBinder.addBinding().to(ShardMetadataSystemTable.class).in(Scopes.SINGLETON); tableBinder.addBinding().to(TableMetadataSystemTable.class).in(Scopes.SINGLETON); tableBinder.addBinding().to(TableStatsSystemTable.class).in(Scopes.SINGLETON); }
Example #13
Source File: AuthzModule.java From arcusplatform with Apache License 2.0 | 6 votes |
@Override protected void configure() { bindMapToInstancesOf( new TypeLiteral<Map<String, PermissionExtractor>>() {}, (PermissionExtractor extractor) -> extractor.getSupportedMessageType()); Multibinder<MessageFilter> filterBinder = bindSetOf(MessageFilter.class); filterBinder.addBinding().to(DefaultMessageFilter.class); filterBinder.addBinding().to(ListDevicesResponseMessageFilter.class); bind(PermissionExtractorRegistry.class); bind(MessageFilterRegistry.class); if(algorithm.equalsIgnoreCase(AUTHZ_ALGORITHM_NONE)) { bind(Authorizer.class).to(NoopAuthorizer.class); } else if(algorithm.equalsIgnoreCase(AUTHZ_ALGORITHM_ROLE)) { bind(Authorizer.class).to(RoleAuthorizer.class); } else { bind(Authorizer.class).to(PermissionsAuthorizer.class); } }
Example #14
Source File: GroovyDriverTestCase.java From arcusplatform with Apache License 2.0 | 6 votes |
@Override protected void configure(Binder binder) { binder .bind(new Key<Set<GroovyDriverPlugin>>() {}) .toInstance(getPlugins()); binder.bind(InMemoryPlatformMessageBus.class).in(Singleton.class); binder.bind(InMemoryProtocolMessageBus.class).in(Singleton.class); binder.bind(PlatformMessageBus.class).to(InMemoryPlatformMessageBus.class); binder.bind(ProtocolMessageBus.class).to(InMemoryProtocolMessageBus.class); Multibinder.newSetBinder(binder, CompilationCustomizer.class) .addBinding() .to(DriverCompilationCustomizer.class); binder .bind(Scheduler.class) .toInstance(new ExecutorScheduler(Executors.newScheduledThreadPool(1))) ; }
Example #15
Source File: GsonModule.java From arcusplatform with Apache License 2.0 | 6 votes |
@Override protected void configure() { bind(com.iris.io.json.JsonSerializer.class).to(GsonSerializerImpl.class); bind(com.iris.io.json.JsonDeserializer.class).to(GsonDeserializerImpl.class); Multibinder .newSetBinder(binder(), new TypeLiteral<com.google.gson.JsonSerializer<?>>() {}) .addBinding() .to(AttributeMapSerializer.class); Multibinder .newSetBinder(binder(), new TypeLiteral<com.google.gson.JsonDeserializer<?>>() {}) .addBinding() .to(AttributeMapSerializer.class); Multibinder .newSetBinder(binder(), new TypeLiteral<TypeAdapter<?>>() {}) .addBinding() .to(ByteArrayToBase64TypeAdapter.class); Multibinder .newSetBinder(binder(), new TypeLiteral<TypeAdapterFactory>() {}) .addBinding() .to(TypeTypeAdapterFactory.class); }
Example #16
Source File: DefaultKernelControlCenterExtensionsModule.java From openAGV with Apache License 2.0 | 6 votes |
@SuppressWarnings("deprecation") private void configureControlCenterDependencies() { KernelControlCenterConfiguration configuration = getConfigBindingProvider().get(KernelControlCenterConfiguration.PREFIX, KernelControlCenterConfiguration.class); bind(KernelControlCenterConfiguration.class).toInstance(configuration); Multibinder<org.opentcs.components.kernel.ControlCenterPanel> modellingBinder = controlCenterPanelBinderModelling(); // No extensions for modelling mode, yet. Multibinder<org.opentcs.components.kernel.ControlCenterPanel> operatingBinder = controlCenterPanelBinderOperating(); operatingBinder.addBinding().to(DriverGUI.class); install(new FactoryModuleBuilder().build(ControlCenterInfoHandlerFactory.class)); bind(KernelControlCenter.class).in(Singleton.class); }
Example #17
Source File: ResourceModule.java From arcusplatform with Apache License 2.0 | 5 votes |
@Override protected void configure() { FileSystemResourceFactory fs = new FileSystemResourceFactory(getRootDirectory()); bind(ResourceFactory.class) .toInstance(fs); Multibinder<ResourceFactory> factoryBinder = bindSetOf(ResourceFactory.class); factoryBinder.addBinding().toInstance(fs); factoryBinder.addBinding().toInstance(new ClassPathResourceFactory()); factoryBinder.addBinding().toInstance(new EnvironmentVariableResourceFactory()); bind(ResourceConfigurer.class) .asEagerSingleton(); }
Example #18
Source File: GroovyProtocolPluginModule.java From arcusplatform with Apache License 2.0 | 5 votes |
@Override protected void configure() { Multibinder<GroovyDriverPlugin> plugins = bindSetOf(GroovyDriverPlugin.class); plugins.addBinding().to(ZWaveProtocolPlugin.class); plugins.addBinding().to(ZigbeeProtocolPlugin.class); plugins.addBinding().to(IpcdProtocolPlugin.class); plugins.addBinding().to(ControlProtocolPlugin.class); plugins.addBinding().to(MockProtocolPlugin.class); plugins.addBinding().to(ReflexPlugin.class); }
Example #19
Source File: GoogleModule.java From arcusplatform with Apache License 2.0 | 5 votes |
@Override protected void configure() { MapBinder<String, ProactiveReportHandler> handlers = MapBinder.newMapBinder(binder(), KEY_LITERAL, VALUE_LITERAL); handlers.addBinding(VoiceService.StartPlaceRequest.ASSISTANT_GOOGLE).to(GoogleProactiveReportHandler.class); Multibinder<VoiceProvider> providerMultibinder = bindSetOf(VoiceProvider.class); providerMultibinder.addBinding().to(GoogleService.class); }
Example #20
Source File: CapabilityDispatcherModule.java From arcusplatform with Apache License 2.0 | 5 votes |
@Override protected void configure() { annotatedObjects = Multibinder.newSetBinder(binder(), Object.class); resolvers = Multibinder.newSetBinder(binder(), new TypeLiteral<ArgumentResolverFactory<PlatformMessage, MessageBody>>() { }); matchers = Multibinder.newSetBinder(binder(), AddressMatcher.class); matchers.addBinding().toInstance(matcher()); bind(Dispatcher.class).asEagerSingleton(); }
Example #21
Source File: AlexaModule.java From arcusplatform with Apache License 2.0 | 5 votes |
@Override protected void configure() { MapBinder<String, ProactiveReportHandler> handlers = MapBinder.newMapBinder(binder(), KEY_LITERAL, VALUE_LITERAL); handlers.addBinding(VoiceService.StartPlaceRequest.ASSISTANT_ALEXA).to(AlexaProactiveReportHandler.class); Multibinder<VoiceProvider> providerMultibinder = bindSetOf(VoiceProvider.class); providerMultibinder.addBinding().to(AlexaService.class); }
Example #22
Source File: HttpHealthCheckModule.java From arcusplatform with Apache License 2.0 | 5 votes |
@Override protected void configure() { bind(HttpHealthCheckServer.class) .asEagerSingleton(); expose(HttpHealthCheckServer.class); OptionalBinder.newOptionalBinder(binder(), ClusterService.class); Multibinder<HttpResource> resourceBinder = Multibinder .newSetBinder(binder(), HttpResource.class, Names.named(HealthCheckServerConfig.NAME_HEALTHCHECK_RESOURCES)); resourceBinder.addBinding().to(CheckPage.class); resourceBinder.addBinding().to(StatusPage.class); }
Example #23
Source File: GoogleBridgeModule.java From arcusplatform with Apache License 2.0 | 5 votes |
@Override protected void configure() { bind(Address.class).annotatedWith(Names.named(VoiceBridgeConfig.NAME_BRIDGEADDRESS)).toInstance(Constants.BRIDGE_ADDRESS); bind(String.class).annotatedWith(Names.named(VoiceBridgeConfig.NAME_BRIDGEASSISTANT)).toInstance(VoiceService.StartPlaceRequest.ASSISTANT_GOOGLE); // Bind Http Handlers Multibinder<RequestHandler> rhBindings = Multibinder.newSetBinder(binder(), RequestHandler.class); rhBindings.addBinding().to(GoogleHomeHandler.class); VoiceBridgeMetrics metrics = new VoiceBridgeMetrics("google-bridge","google.bridge", "intent"); bind(BridgeMetrics.class).toInstance(metrics); bind(VoiceBridgeMetrics.class).toInstance(metrics); }
Example #24
Source File: ProductCatalogServiceModule.java From arcusplatform with Apache License 2.0 | 5 votes |
@Override protected void configure() { Multibinder<ContextualRequestMessageHandler<ProductCatalog>> handlerBinder = bindSetOf(new TypeLiteral<ContextualRequestMessageHandler<ProductCatalog>>() {}); handlerBinder.addBinding().to(FindProductsHandler.class); handlerBinder.addBinding().to(GetBrandsHandler.class); handlerBinder.addBinding().to(GetCategoriesHandler.class); handlerBinder.addBinding().to(GetProductCatalogHandler.class); handlerBinder.addBinding().to(GetProductHandler.class); handlerBinder.addBinding().to(GetProductsByBrandHandler.class); handlerBinder.addBinding().to(GetProductsByCategoryHandler.class); handlerBinder.addBinding().to(GetProductsHandler.class); handlerBinder.addBinding().to(GetAllProductsHandler.class); bindSetOf(PlatformService.class).addBinding().to(ProductCatalogService.class); }
Example #25
Source File: PlaceServiceModule.java From arcusplatform with Apache License 2.0 | 5 votes |
@Override protected void configure() { Multibinder<ContextualRequestMessageHandler<Place>> handlerBinder = bindSetOf(new TypeLiteral<ContextualRequestMessageHandler<Place>>() {}); handlerBinder.addBinding().to(PlaceGetAttributesHandler.class); handlerBinder.addBinding().to(PlaceSetAttributesHandler.class); handlerBinder.addBinding().to(ListDevicesHandler.class); handlerBinder.addBinding().to(GetHubHandler.class); handlerBinder.addBinding().to(RegisterHubHandler.class); handlerBinder.addBinding().to(StartAddingDevicesHandler.class); handlerBinder.addBinding().to(StopAddingDevicesHandler.class); handlerBinder.addBinding().to(ListPersonsHandler.class); handlerBinder.addBinding().to(AddPersonHandler.class); handlerBinder.addBinding().to(PlaceDeleteHandler.class); handlerBinder.addBinding().to(ListDashboardEntriesHandler.class); handlerBinder.addBinding().to(ListHistoryEntriesHandler.class); handlerBinder.addBinding().to(new TypeLiteral<AddTagsHandler<Place>>() {}); handlerBinder.addBinding().to(new TypeLiteral<RemoveTagsHandler<Place>>() {}); handlerBinder.addBinding().to(CreateInvitationHandler.class); handlerBinder.addBinding().to(SendInvitationHandler.class); handlerBinder.addBinding().to(PendingInvitationsHandler.class); handlerBinder.addBinding().to(CancelInvitationHandler.class); handlerBinder.addBinding().to(ListPersonsWithAccessHandler.class); handlerBinder.addBinding().to(PlaceUpdateAddressHandler.class); handlerBinder.addBinding().to(ValidateAddressHandler.class); handlerBinder.addBinding().to(RegisterHubV2Handler.class); Multibinder<ContextualEventMessageHandler<Place>> eventHandler = bindSetOf(new TypeLiteral<ContextualEventMessageHandler<Place>>() {}); bindSetOf(PlatformService.class).addBinding().to(PlaceService.class); }
Example #26
Source File: AccountServiceModule.java From arcusplatform with Apache License 2.0 | 5 votes |
@Override protected void configure() { bind(SubscriptionUpdater.class).to(SubscriptionUpdaterImpl.class); Multibinder<ContextualRequestMessageHandler<Account>> handlerBinder = bindSetOf(new TypeLiteral<ContextualRequestMessageHandler<Account>>() {}); handlerBinder.addBinding().to(AccountGetAttributesHandler.class); handlerBinder.addBinding().to(AccountSetAttributesHandler.class); handlerBinder.addBinding().to(CreateAccountHandler.class); handlerBinder.addBinding().to(ListDevicesHandler.class); handlerBinder.addBinding().to(ListHubsHandler.class); handlerBinder.addBinding().to(ListPlacesHandler.class); handlerBinder.addBinding().to(SignupTransitionHandler.class); handlerBinder.addBinding().to(UpdateBillingInfoCCHandler.class); handlerBinder.addBinding().to(UpdateBillingInfoHandler.class); handlerBinder.addBinding().to(CreateBillingAccountHandler.class); handlerBinder.addBinding().to(UpdateServicePlanHandler.class); handlerBinder.addBinding().to(ListInvoicesHandler.class); handlerBinder.addBinding().to(ListAdjustmentsHandler.class); handlerBinder.addBinding().to(AddPlaceHandler.class); handlerBinder.addBinding().to(AccountDeleteHandler.class); handlerBinder.addBinding().to(IssueCreditHandler.class); handlerBinder.addBinding().to(IssueInvoiceRefundHandler.class); handlerBinder.addBinding().to(SkipPremiumTrialHandler.class); handlerBinder.addBinding().to(new TypeLiteral<AddTagsHandler<Account>>() {}); handlerBinder.addBinding().to(new TypeLiteral<RemoveTagsHandler<Account>>() {}); handlerBinder.addBinding().to(AccountActivateHandler.class); Multibinder<ContextualEventMessageHandler<Account>> eventHandlerBinder = bindSetOf(new TypeLiteral<ContextualEventMessageHandler<Account>>() {}); eventHandlerBinder.addBinding().to(DelinquentAccountEventHandler.class); Multibinder<PlatformService> serviceBinder = bindSetOf(PlatformService.class); serviceBinder.addBinding().to(AccountService.class); serviceBinder.addBinding().to(AccountMigrationService.class); }
Example #27
Source File: MobileDeviceServiceModule.java From arcusplatform with Apache License 2.0 | 5 votes |
@Override protected void configure() { Multibinder<ContextualRequestMessageHandler<MobileDevice>> handlerBinder = bindSetOf(new TypeLiteral<ContextualRequestMessageHandler<MobileDevice>>() {}); handlerBinder.addBinding().to(MobileDeviceGetAttributesHandler.class); handlerBinder.addBinding().to(MobileDeviceSetAttributesHandler.class); bindSetOf(PlatformService.class).addBinding().to(MobileDeviceService.class); }
Example #28
Source File: PopulationServiceModule.java From arcusplatform with Apache License 2.0 | 5 votes |
@Override protected void configure() { Multibinder<ContextualRequestMessageHandler<Population>> handlerBinder = bindSetOf(new TypeLiteral<ContextualRequestMessageHandler<Population>>() {}); handlerBinder.addBinding().to(ListPopulationsHandler.class); handlerBinder.addBinding().to(AddPlacesToPopulationHandler.class); handlerBinder.addBinding().to(RemovePlacesFromPopulationHandler.class); bindSetOf(PlatformService.class).addBinding().to(PopulationService.class); }
Example #29
Source File: ReconControllerModule.java From hadoop-ozone with Apache License 2.0 | 5 votes |
@Override protected void configure() { Multibinder<ReconOmTask> taskBinder = Multibinder.newSetBinder(binder(), ReconOmTask.class); taskBinder.addBinding().to(ContainerKeyMapperTask.class); taskBinder.addBinding().to(FileSizeCountTask.class); }
Example #30
Source File: VoiceBridgeModule.java From arcusplatform with Apache License 2.0 | 5 votes |
@Override protected void configure() { bind(BridgeServerConfig.class); bind(BridgeServerTlsContext.class).to(BridgeServerTlsContextImpl.class); bind(BridgeServerTrustManagerFactory.class).to(NullTrustManagerFactoryImpl.class); bind(ChannelInboundHandler.class).toProvider(BaseWebSocketServerHandlerProvider.class); bind(CHANNEL_INITIALIZER_TYPE_LITERAL).to(HttpRequestInitializer.class); bind(RequestMatcher.class).annotatedWith(Names.named("WebSocketUpgradeMatcher")).to(NeverMatcher.class); bind(IrisNettyAuthorizationContextLoader.class).to(IrisNettyNoopAuthorizationContextLoader.class); // No Session Listeners Multibinder<SessionListener> slBindings = Multibinder.newSetBinder(binder(), SessionListener.class); // Bind Http Handlers Multibinder<RequestHandler> rhBindings = Multibinder.newSetBinder(binder(), RequestHandler.class); rhBindings.addBinding().to(RootRedirect.class); rhBindings.addBinding().to(IndexPage.class); rhBindings.addBinding().to(CheckPage.class); rhBindings.addBinding().to(SessionLogin.class); rhBindings.addBinding().to(SessionLogout.class); rhBindings.addBinding().to(ListPlacesRESTHandler.class); rhBindings.addBinding().to(TokenHandler.class); rhBindings.addBinding().to(RevokeHandler.class); rhBindings.addBinding().to(AuthorizeHandler.class); // oauth bind(OAuthDAO.class).to(CassandraOAuthDAO.class); bind(RequestAuthorizer.class).annotatedWith(Names.named("SessionAuthorizer")).to(SessionAuth.class); bind(SessionFactory.class).to(DefaultSessionFactoryImpl.class); bind(SessionRegistry.class).to(DefaultSessionRegistryImpl.class); bind(Responder.class).annotatedWith(Names.named("SessionLogin")).to(SessionLoginResponder.class); bind(Responder.class).annotatedWith(Names.named("SessionLogout")).to(SessionLogoutResponder.class); bind(Authenticator.class).to(ShiroAuthenticator.class); bind(PlaceSelectionHandler.class).to(VoicePlaceSelectionHandler.class); }