com.google.inject.multibindings.Multibinder#newSetBinder ( )源码实例Demo

下面列出了com.google.inject.multibindings.Multibinder#newSetBinder ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: presto   文件: KuduModule.java
@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);
}
 
源代码2 项目: arcusplatform   文件: VideoPreviewServerModule.java
@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);
}
 
源代码3 项目: arcusplatform   文件: AlexaServerModule.java
@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);
}
 
@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();
}
 
源代码5 项目: presto   文件: SystemConnectorModule.java
@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();
}
 
源代码6 项目: openAGV   文件: ControlCenterInjectionModule.java
/**
 * 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);
}
 
@Override
protected void configure() {
   super.configure();
   
   Multibinder<HttpResource> resourceBinder =
         Multibinder
            .newSetBinder(binder(), HttpResource.class, Names.named(HealthCheckServerConfig.NAME_HEALTHCHECK_RESOURCES));
   resourceBinder.addBinding().to(ClientSessionsPage.class);
   resourceBinder.addBinding().to(AdHocSessionAction.class);
}
 
源代码8 项目: arcusplatform   文件: VoiceBridgeModule.java
@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);
}
 
源代码9 项目: presto   文件: KinesisModule.java
private static void bindInternalColumn(Binder binder, KinesisInternalFieldDescription fieldDescription)
{
    Multibinder<KinesisInternalFieldDescription> fieldDescriptionBinder = Multibinder.newSetBinder(binder, KinesisInternalFieldDescription.class);
    fieldDescriptionBinder.addBinding().toInstance(fieldDescription);
}
 
源代码10 项目: arcusplatform   文件: AbstractIrisModule.java
protected <T> Multibinder<T> bindSetOf(TypeLiteral<T> type) {
	return Multibinder.newSetBinder(binder(), type);
}
 
源代码11 项目: arcusplatform   文件: AbstractIrisModule.java
protected <T> Multibinder<T> bindSetOf(Class<T> type) {
	return Multibinder.newSetBinder(binder(), type);
}
 
源代码12 项目: arcusplatform   文件: HubServerModule.java
@Override
protected void configure() {
    bind(TrustConfig.class);

    bind(HubMessageFilter.class).to(DefaultHubMessageFilterImpl.class);

    bind(BridgeServerTlsContext.class).to(BridgeServerTlsContextImpl.class);
    bind(BridgeServerTrustManagerFactory.class).to(HubTrustManagerFactoryImpl.class);
    bind(PlatformBusService.class).to(PlatformBusServiceImpl.class).asEagerSingleton();
    bind(ProtocolBusService.class).to(ProtocolBusServiceImpl.class).asEagerSingleton();
    bindSetOf(PlatformBusListener.class)
            .addBinding()
            .to(HubPlatformBusListener.class);

    bindSetOf(ProtocolBusListener.class)
            .addBinding()
            .to(HubProtocolBusListener.class);

    bind(new TypeLiteral<DeviceMessageHandler<ByteBuf>>() {
    }).to(HubMessageHandler.class);

    Multibinder<DirectMessageHandler> directHandlers = bindSetOf(DirectMessageHandler.class);
    directHandlers.addBinding().to(HubConnectedHandler.class);
    directHandlers.addBinding().to(HubRegisteredResponseHandler.class);
    directHandlers.addBinding().to(HubFirmwareUpgradeProcessEventHandler.class);
    directHandlers.addBinding().to(HubFirmwareUpdateResponseHandler.class);


    bind(new TypeLiteral<ChannelInitializer<SocketChannel>>() {
    }).to(Bridge10ChannelInitializer.class);
    bind(ChannelInboundHandler.class).toProvider(Binary10WebSocketServerHandlerProvider.class);

    bind(RequestMatcher.class).annotatedWith(Names.named("WebSocketUpgradeMatcher")).to(WebSocketUpgradeMatcher.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);
    if (clientAuthRequired) {
        rhBindings.addBinding().to(RootRedirect.class);
        rhBindings.addBinding().to(IndexPage.class);
    } else {
        rhBindings.addBinding().to(RootRemoteRedirect.class);
    }
    rhBindings.addBinding().to(CheckPage.class);

}
 
源代码13 项目: arcusplatform   文件: ProtocolMessagesModule.java
@Override
protected void configure() {
   Multibinder<TypeAdapterFactory> typeAdapterFactoryBinder = Multibinder.newSetBinder(binder(), new TypeLiteral<TypeAdapterFactory>() {});
   typeAdapterFactoryBinder.addBinding().to(ProtocolMessageTypeAdapterFactory.class);
}
 
源代码14 项目: openAGV   文件: KernelInjectionModule.java
/**
 * Returns a multibinder that can be used to register 
 * {@link org.opentcs.components.kernel.ControlCenterPanel} implementations for the kernel's 
 * operating mode.
 *
 * @return The multibinder.
 * @deprecated Use {@link ControlCenterInjectionModule#controlCenterPanelBinderOperating()}
 * instead.
 */
@Deprecated
@ScheduledApiChange(when = "5.0")
protected Multibinder<org.opentcs.components.kernel.ControlCenterPanel> controlCenterPanelBinderOperating() {
  return Multibinder.newSetBinder(binder(),
                                  org.opentcs.components.kernel.ControlCenterPanel.class,
                                  ActiveInOperatingMode.class);
}
 
源代码15 项目: openAGV   文件: PlantOverviewInjectionModule.java
/**
 * Returns a multibinder that can be used to register classes that provide suggested order
 * categories.
 *
 * @return The multibinder.
 */
protected Multibinder<OrderCategorySuggestions> orderCategorySuggestionsBinder() {
  return Multibinder.newSetBinder(binder(), OrderCategorySuggestions.class);
}
 
源代码16 项目: openAGV   文件: PlantOverviewInjectionModule.java
/**
 * Returns a multibinder that can be used to register factories for pluggable panels.
 *
 * @return The multibinder.
 */
protected Multibinder<PluggablePanelFactory> pluggablePanelFactoryBinder() {
  return Multibinder.newSetBinder(binder(), PluggablePanelFactory.class);
}
 
源代码17 项目: openAGV   文件: KernelInjectionModule.java
/**
 * Returns a multibinder that can be used to register kernel extensions for all kernel states.
 *
 * @return The multibinder.
 */
protected Multibinder<KernelExtension> extensionsBinderAllModes() {
  return Multibinder.newSetBinder(binder(), KernelExtension.class, ActiveInAllModes.class);
}
 
源代码18 项目: openAGV   文件: PlantOverviewInjectionModule.java
/**
 * Returns a multibinder that can be used to register plant model exporters.
 *
 * @return The multibinder.
 */
protected Multibinder<PlantModelExporter> plantModelExporterBinder() {
  return Multibinder.newSetBinder(binder(), PlantModelExporter.class);
}
 
源代码19 项目: openAGV   文件: PlantOverviewInjectionModule.java
/**
 * Returns a multibinder that can be used to register location themes.
 *
 * @return The multibinder.
 * @deprecated The theme to be used is now set directly via configuration.
 */
@Deprecated
@ScheduledApiChange(when = "5.0", details = "Will be removed.")
protected Multibinder<LocationTheme> locationThemeBinder() {
  return Multibinder.newSetBinder(binder(), LocationTheme.class);
}
 
源代码20 项目: openAGV   文件: PlantOverviewInjectionModule.java
/**
 * Returns a multibinder that can be used to register plant model importers.
 *
 * @return The multibinder.
 */
protected Multibinder<PlantModelImporter> plantModelImporterBinder() {
  return Multibinder.newSetBinder(binder(), PlantModelImporter.class);
}