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 Project: arcusplatform Author: arcus-smart-home File: MessagesModule.java License: 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 Project: presto Author: prestosql File: RaptorModule.java License: 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 #3
Source Project: presto Author: prestosql File: KuduModule.java License: 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 #4
Source Project: openAGV Author: tcrct File: DefaultKernelControlCenterExtensionsModule.java License: 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 #5
Source Project: arcusplatform Author: arcus-smart-home File: GroovyDriverTestCase.java License: 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 #6
Source Project: arcusplatform Author: arcus-smart-home File: AlexaServerModule.java License: 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 #7
Source Project: arcusplatform Author: arcus-smart-home File: VideoPreviewServerModule.java License: 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 #8
Source Project: arcusplatform Author: arcus-smart-home File: HubServiceModule.java License: 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 Project: arcusplatform Author: arcus-smart-home File: PersonServiceModule.java License: 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 #10
Source Project: arcusplatform Author: arcus-smart-home File: IvrFallbackServerModule.java License: 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 #11
Source Project: arcusplatform Author: arcus-smart-home File: BillingServerModule.java License: 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 #12
Source Project: arcusplatform Author: arcus-smart-home File: IvrServerModule.java License: 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 #13
Source Project: arcusplatform Author: arcus-smart-home File: DriverModule.java License: 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 #14
Source Project: arcusplatform Author: arcus-smart-home File: TagServiceModule.java License: 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 #15
Source Project: arcusplatform Author: arcus-smart-home File: AuthzModule.java License: 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 #16
Source Project: arcusplatform Author: arcus-smart-home File: GsonModule.java License: 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 #17
Source Project: hadoop-ozone Author: apache File: ReconControllerModule.java License: 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 #18
Source Project: hadoop-ozone Author: apache File: ReconSchemaGenerationModule.java License: Apache License 2.0 | 5 votes |
@Override protected void configure() { // SQL schema creation and related bindings Multibinder<ReconSchemaDefinition> schemaBinder = Multibinder.newSetBinder(binder(), ReconSchemaDefinition.class); schemaBinder.addBinding().to(UtilizationSchemaDefinition.class); schemaBinder.addBinding().to(ContainerSchemaDefinition.class); schemaBinder.addBinding().to(ReconTaskSchemaDefinition.class); schemaBinder.addBinding().to(StatsSchemaDefinition.class); }
Example #19
Source Project: presto Author: prestosql File: PrestoVerifierModule.java License: Apache License 2.0 | 5 votes |
@Override protected void setup(Binder binder) { configBinder(binder).bindConfig(VerifierConfig.class); eventBinder(binder).bindEventClient(VerifierQueryEvent.class); Multibinder<String> supportedClients = newSetBinder(binder, String.class, SupportedEventClients.class); supportedClients.addBinding().toInstance("human-readable"); supportedClients.addBinding().toInstance("file"); Set<String> eventClientTypes = buildConfigObject(VerifierConfig.class).getEventClients(); bindEventClientClasses(eventClientTypes, newSetBinder(binder, EventClient.class)); }
Example #20
Source Project: presto Author: prestosql File: PrestoVerifierModule.java License: Apache License 2.0 | 5 votes |
private static void bindEventClientClasses(Set<String> eventClientTypes, Multibinder<EventClient> multibinder) { for (String eventClientType : eventClientTypes) { if (eventClientType.equals("human-readable")) { multibinder.addBinding().to(HumanReadableEventClient.class).in(Scopes.SINGLETON); } else if (eventClientType.equals("file")) { multibinder.addBinding().to(JsonEventClient.class).in(Scopes.SINGLETON); } } }
Example #21
Source Project: presto Author: prestosql File: SystemConnectorModule.java License: Apache License 2.0 | 5 votes |
@Override public void configure(Binder binder) { Multibinder<SystemTable> globalTableBinder = Multibinder.newSetBinder(binder, SystemTable.class); globalTableBinder.addBinding().to(NodeSystemTable.class).in(Scopes.SINGLETON); globalTableBinder.addBinding().to(QuerySystemTable.class).in(Scopes.SINGLETON); globalTableBinder.addBinding().to(TaskSystemTable.class).in(Scopes.SINGLETON); globalTableBinder.addBinding().to(CatalogSystemTable.class).in(Scopes.SINGLETON); globalTableBinder.addBinding().to(TableCommentSystemTable.class).in(Scopes.SINGLETON); globalTableBinder.addBinding().to(SchemaPropertiesSystemTable.class).in(Scopes.SINGLETON); globalTableBinder.addBinding().to(TablePropertiesSystemTable.class).in(Scopes.SINGLETON); globalTableBinder.addBinding().to(ColumnPropertiesSystemTable.class).in(Scopes.SINGLETON); globalTableBinder.addBinding().to(AnalyzePropertiesSystemTable.class).in(Scopes.SINGLETON); globalTableBinder.addBinding().to(TransactionsSystemTable.class).in(Scopes.SINGLETON); globalTableBinder.addBinding().to(AttributeJdbcTable.class).in(Scopes.SINGLETON); globalTableBinder.addBinding().to(CatalogJdbcTable.class).in(Scopes.SINGLETON); globalTableBinder.addBinding().to(ColumnJdbcTable.class).in(Scopes.SINGLETON); globalTableBinder.addBinding().to(TypesJdbcTable.class).in(Scopes.SINGLETON); globalTableBinder.addBinding().to(ProcedureColumnJdbcTable.class).in(Scopes.SINGLETON); globalTableBinder.addBinding().to(ProcedureJdbcTable.class).in(Scopes.SINGLETON); globalTableBinder.addBinding().to(PseudoColumnJdbcTable.class).in(Scopes.SINGLETON); globalTableBinder.addBinding().to(SchemaJdbcTable.class).in(Scopes.SINGLETON); globalTableBinder.addBinding().to(SuperTableJdbcTable.class).in(Scopes.SINGLETON); globalTableBinder.addBinding().to(SuperTypeJdbcTable.class).in(Scopes.SINGLETON); globalTableBinder.addBinding().to(TableJdbcTable.class).in(Scopes.SINGLETON); globalTableBinder.addBinding().to(TableTypeJdbcTable.class).in(Scopes.SINGLETON); globalTableBinder.addBinding().to(UdtJdbcTable.class).in(Scopes.SINGLETON); Multibinder.newSetBinder(binder, Procedure.class); binder.bind(KillQueryProcedure.class).in(Scopes.SINGLETON); binder.bind(GlobalSystemConnectorFactory.class).in(Scopes.SINGLETON); binder.bind(SystemConnectorRegistrar.class).asEagerSingleton(); }
Example #22
Source Project: presto Author: prestosql File: HiveProcedureModule.java License: Apache License 2.0 | 5 votes |
@Override public void configure(Binder binder) { Multibinder<Procedure> procedures = newSetBinder(binder, Procedure.class); procedures.addBinding().toProvider(CreateEmptyPartitionProcedure.class).in(Scopes.SINGLETON); procedures.addBinding().toProvider(RegisterPartitionProcedure.class).in(Scopes.SINGLETON); procedures.addBinding().toProvider(UnregisterPartitionProcedure.class).in(Scopes.SINGLETON); procedures.addBinding().toProvider(SyncPartitionMetadataProcedure.class).in(Scopes.SINGLETON); procedures.addBinding().toProvider(DropStatsProcedure.class).in(Scopes.SINGLETON); }
Example #23
Source Project: presto Author: prestosql File: GlueMetastoreModule.java License: Apache License 2.0 | 5 votes |
@Override protected void setup(Binder binder) { configBinder(binder).bindConfig(GlueHiveMetastoreConfig.class); newOptionalBinder(binder, GlueColumnStatisticsProvider.class) .setDefault().to(DisabledGlueColumnStatisticsProvider.class).in(Scopes.SINGLETON); newOptionalBinder(binder, Key.get(RequestHandler2.class, ForGlueHiveMetastore.class)); if (buildConfigObject(HiveConfig.class).getRecordingPath() != null) { binder.bind(HiveMetastore.class) .annotatedWith(ForRecordingHiveMetastore.class) .to(GlueHiveMetastore.class) .in(Scopes.SINGLETON); binder.bind(GlueHiveMetastore.class).in(Scopes.SINGLETON); newExporter(binder).export(GlueHiveMetastore.class).withGeneratedName(); binder.bind(HiveMetastore.class) .annotatedWith(ForCachingHiveMetastore.class) .to(RecordingHiveMetastore.class) .in(Scopes.SINGLETON); binder.bind(RecordingHiveMetastore.class).in(Scopes.SINGLETON); newExporter(binder).export(RecordingHiveMetastore.class).withGeneratedName(); Multibinder<Procedure> procedures = newSetBinder(binder, Procedure.class); procedures.addBinding().toProvider(WriteHiveMetastoreRecordingProcedure.class).in(Scopes.SINGLETON); } else { binder.bind(HiveMetastore.class) .annotatedWith(ForCachingHiveMetastore.class) .to(GlueHiveMetastore.class) .in(Scopes.SINGLETON); newExporter(binder).export(HiveMetastore.class) .as(generator -> generator.generatedNameOf(GlueHiveMetastore.class)); } binder.install(new CachingHiveMetastoreModule()); }
Example #24
Source Project: presto Author: prestosql File: ThriftMetastoreModule.java License: Apache License 2.0 | 5 votes |
@Override protected void setup(Binder binder) { OptionalBinder.newOptionalBinder(binder, ThriftMetastoreClientFactory.class) .setDefault().to(DefaultThriftMetastoreClientFactory.class).in(Scopes.SINGLETON); binder.bind(MetastoreLocator.class).to(StaticMetastoreLocator.class).in(Scopes.SINGLETON); configBinder(binder).bindConfig(StaticMetastoreConfig.class); configBinder(binder).bindConfig(ThriftMetastoreConfig.class); binder.bind(ThriftMetastore.class).to(ThriftHiveMetastore.class).in(Scopes.SINGLETON); newExporter(binder).export(ThriftMetastore.class) .as(generator -> generator.generatedNameOf(ThriftHiveMetastore.class)); if (buildConfigObject(HiveConfig.class).getRecordingPath() != null) { binder.bind(HiveMetastore.class) .annotatedWith(ForRecordingHiveMetastore.class) .to(BridgingHiveMetastore.class) .in(Scopes.SINGLETON); binder.bind(HiveMetastore.class) .annotatedWith(ForCachingHiveMetastore.class) .to(RecordingHiveMetastore.class) .in(Scopes.SINGLETON); binder.bind(RecordingHiveMetastore.class).in(Scopes.SINGLETON); newExporter(binder).export(RecordingHiveMetastore.class).withGeneratedName(); Multibinder<Procedure> procedures = newSetBinder(binder, Procedure.class); procedures.addBinding().toProvider(WriteHiveMetastoreRecordingProcedure.class).in(Scopes.SINGLETON); } else { binder.bind(HiveMetastore.class) .annotatedWith(ForCachingHiveMetastore.class) .to(BridgingHiveMetastore.class) .in(Scopes.SINGLETON); } binder.install(new CachingHiveMetastoreModule()); install(new ThriftMetastoreAuthenticationModule()); }
Example #25
Source Project: openAGV Author: tcrct File: DefaultSchedulerModule.java License: Apache License 2.0 | 5 votes |
private void configureSchedulerDependencies() { bind(ReservationPool.class).in(Singleton.class); Multibinder<Scheduler.Module> moduleBinder = Multibinder.newSetBinder(binder(), Scheduler.Module.class); moduleBinder.addBinding().to(SingleVehicleBlockModule.class); moduleBinder.addBinding().to(SameDirectionBlockModule.class); }
Example #26
Source Project: openAGV Author: tcrct File: ControlCenterInjectionModule.java License: Apache License 2.0 | 5 votes |
/** * Returns a multibinder that can be used to register {@link ControlCenterPanel} implementations * for the kernel's modelling mode. * * @return The multibinder. */ @SuppressWarnings("deprecation") protected Multibinder<org.opentcs.components.kernel.ControlCenterPanel> controlCenterPanelBinderModelling() { return Multibinder.newSetBinder(binder(), org.opentcs.components.kernel.ControlCenterPanel.class, ActiveInModellingMode.class); }
Example #27
Source Project: openAGV Author: tcrct File: ControlCenterInjectionModule.java License: Apache License 2.0 | 5 votes |
/** * Returns a multibinder that can be used to register {@link ControlCenterPanel} implementations * for the kernel's operating mode. * * @return The multibinder. */ @SuppressWarnings("deprecation") protected Multibinder<org.opentcs.components.kernel.ControlCenterPanel> controlCenterPanelBinderOperating() { return Multibinder.newSetBinder(binder(), org.opentcs.components.kernel.ControlCenterPanel.class, ActiveInOperatingMode.class); }
Example #28
Source Project: arcusplatform Author: arcus-smart-home File: VoiceBridgeModule.java License: 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); }
Example #29
Source Project: arcusplatform Author: arcus-smart-home File: VideoStreamingServerModule.java License: Apache License 2.0 | 5 votes |
@Override protected void configure() { bind(BridgeServerConfig.class); bind(VideoStreamingServerConfig.class); bind(BridgeServerTlsContext.class).to(BridgeServerTlsContextImpl.class); bind(BridgeServerTrustManagerFactory.class).to(NullTrustManagerFactoryImpl.class); bind(SessionFactory.class).to(NullSessionFactoryImpl.class); bind(SessionRegistry.class).to(NullSessionRegistryImpl.class); bind(ClientFactory.class).to(VideoStreamingClientFactory.class); bind(ChannelInboundHandler.class).toProvider(BaseWebSocketServerHandlerProvider.class); bind(new TypeLiteral<ChannelInitializer<SocketChannel>>(){}).to(HttpRequestInitializer.class); bind(RequestMatcher.class).annotatedWith(Names.named("WebSocketUpgradeMatcher")).to(NeverMatcher.class); bind(RequestAuthorizer.class).annotatedWith(Names.named("SessionAuthorizer")).to(AlwaysAllow.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(CheckPage.class); rhBindings.addBinding().to(HlsHandler.class); rhBindings.addBinding().to(HlsPlaylistHandler.class); rhBindings.addBinding().to(HlsIFrameHandler.class); rhBindings.addBinding().to(HlsVideoHandler.class); rhBindings.addBinding().to(JPGHandler.class); if (dash) { rhBindings.addBinding().to(DashVideoHandler.class); } }
Example #30
Source Project: arcusplatform Author: arcus-smart-home File: PopulationServiceModule.java License: 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); }