Package com.google.inject.assistedinject

Examples of com.google.inject.assistedinject.FactoryModuleBuilder


    return jpaPersistModule;
  }

  private void installFactories() {
    install(new FactoryModuleBuilder().implement(
        Cluster.class, ClusterImpl.class).build(ClusterFactory.class));
    install(new FactoryModuleBuilder().implement(
        Host.class, HostImpl.class).build(HostFactory.class));
    install(new FactoryModuleBuilder().implement(
        Service.class, ServiceImpl.class).build(ServiceFactory.class));
    install(new FactoryModuleBuilder().implement(
        ServiceComponent.class, ServiceComponentImpl.class).build(
        ServiceComponentFactory.class));
    install(new FactoryModuleBuilder().implement(
        ServiceComponentHost.class, ServiceComponentHostImpl.class).build(
        ServiceComponentHostFactory.class));
    install(new FactoryModuleBuilder().implement(
        Config.class, ConfigImpl.class).build(ConfigFactory.class));
    install(new FactoryModuleBuilder().build(StageFactory.class));
    install(new FactoryModuleBuilder().build(HostRoleCommandFactory.class));
  }
View Full Code Here


  @SuppressWarnings("unused")
  private static final Logger log = Logger.getLogger(StoreModuleHelper.class.getName());

  public static <F, P> Module factoryModule(Class<F> factoryClass, Class<P> productClass) {
    return new FactoryModuleBuilder()
        .implement(productClass, productClass)
        .build(factoryClass);
  }
View Full Code Here

  public Module getInMemoryModule() {
    return new PrivateModule() {
      @Override
      protected void configure() {
        install(new FactoryModuleBuilder()
                  .implement(DatasetDefinitionRegistry.class, DefaultDatasetDefinitionRegistry.class)
                  .build(DatasetDefinitionRegistryFactory.class));

        bind(new TypeLiteral<DatasetModule>() { }).annotatedWith(Names.named("serviceModule"))
          .toInstance(new InMemoryKVTableDefinition.Module());
View Full Code Here

  public Module getStandaloneModule() {
    return new PrivateModule() {
      @Override
      protected void configure() {
        install(new FactoryModuleBuilder()
                  .implement(DatasetDefinitionRegistry.class, DefaultDatasetDefinitionRegistry.class)
                  .build(DatasetDefinitionRegistryFactory.class));

        bind(new TypeLiteral<DatasetModule>() { }).annotatedWith(Names.named("serviceModule"))
          .toInstance(new LevelDBKVTableDefinition.Module());
View Full Code Here

  public Module getDistributedModule() {
    return new PrivateModule() {
      @Override
      protected void configure() {
        install(new FactoryModuleBuilder()
                  .implement(DatasetDefinitionRegistry.class, DefaultDatasetDefinitionRegistry.class)
                  .build(DatasetDefinitionRegistryFactory.class));

        bind(new TypeLiteral<DatasetModule>() { }).annotatedWith(Names.named("serviceModule"))
          .toInstance(new HBaseKVTableDefinition.Module());
View Full Code Here

    @Override
    protected void configure() {
      bind(PipelineFactory.class).to(SynchronousPipelineFactory.class);

      install(
        new FactoryModuleBuilder()
          .implement(new TypeLiteral<Manager<Location, ApplicationWithPrograms>>() { },
                     new TypeLiteral<LocalManager<Location, ApplicationWithPrograms>>() { })
          .build(new TypeLiteral<ManagerFactory<Location, ApplicationWithPrograms>>() { })
      );
View Full Code Here

    bind(TransactionSystemClient.class)
      .annotatedWith(Names.named("transaction.off"))
      .to(DetachedTxSystemClient.class).in(Scopes.SINGLETON);

    // When transaction is off, use a TransactionExecutorFactory that uses DetachedTxSystemClient
    install(new FactoryModuleBuilder()
              .implement(TransactionExecutor.class, DetachedTransactionExecutor.class)
              .build(Key.get(TransactionExecutorFactory.class, Names.named("transaction.off"))));

    // Creates a DataFabricFacadeFactory injection for creating DataFabricFacade of different types.
    install(
      new FactoryModuleBuilder()
        .implement(DataFabricFacade.class, TransactionDataFabricFacade.class)
        .implement(DataFabricFacade.class, Names.named("transaction.off"), DetachedDataFabricFacade.class)
        .build(DataFabricFacadeFactory.class)
    );
View Full Code Here

          // Data-fabric bindings
          bind(HBaseTableUtil.class).toProvider(HBaseTableUtilFactory.class);

          // txds2
          install(new FactoryModuleBuilder()
                    .implement(DatasetDefinitionRegistry.class, DefaultDatasetDefinitionRegistry.class)
                    .build(DatasetDefinitionRegistryFactory.class));
          bind(DatasetTypeClassLoaderFactory.class).to(DistributedDatasetTypeClassLoaderFactory.class);
          bind(DatasetFramework.class).to(RemoteDatasetFramework.class);
View Full Code Here

    return Modules.combine(super.createModule(context),
                           new AbstractModule() {
                             @Override
                             protected void configure() {
                               // Create webapp http handler factory.
                               install(new FactoryModuleBuilder()
                                         .implement(JarHttpHandler.class, ExplodeJarHttpHandler.class)
                                         .build(WebappHttpHandlerFactory.class));
                             }
                           });
  }
View Full Code Here

    // For binding DataSet transaction stuff
    install(new DataFabricFacadeModule());

    // Create webapp http handler factory.
    install(new FactoryModuleBuilder().implement(JarHttpHandler.class, IntactJarHttpHandler.class)
              .build(WebappHttpHandlerFactory.class));
  }
View Full Code Here

TOP

Related Classes of com.google.inject.assistedinject.FactoryModuleBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.