Examples of FactoryModuleBuilder


Examples of com.google.inject.assistedinject.FactoryModuleBuilder

      }).to(CreateUniqueKeyPair.class);
      bind(new TypeLiteral<Function<RegionNameAndPublicKeyMaterial, KeyPair>>() {
      }).to(ImportOrReturnExistingKeypair.class);
      bind(new TypeLiteral<CacheLoader<RegionAndName, Image>>() {
      }).to(RegionAndIdToImage.class);
      install(new FactoryModuleBuilder().build(CallForImages.Factory.class));
      bind(new TypeLiteral<Function<org.jclouds.ec2.domain.Image, Image>>() {
      }).to(EC2ImageParser.class);
      bind(new TypeLiteral<ImageExtension>() {
      }).to(EC2ImageExtension.class);
   }
View Full Code Here

Examples of com.google.inject.assistedinject.FactoryModuleBuilder

            }).to(GetFirewallRulesByVirtualMachine.class);
            bind(new TypeLiteral<CacheLoader<String, Zone>>() {}).
               to(ZoneIdToZone.class);
            bind(new TypeLiteral<Supplier<LoadingCache<String, Zone>>>() {}).
               to(ZoneIdToZoneSupplier.class);
            install(new FactoryModuleBuilder().build(StaticNATVirtualMachineInNetwork.Factory.class));
         }
        
         @Provides
         @Singleton
         Supplier<Credentials> supplyCredentials(){
View Full Code Here

Examples of com.google.inject.assistedinject.FactoryModuleBuilder

      bind(new TypeLiteral<Function<Zone, Location>>() {
      }).to(ZoneToLocation.class);
      bind(TemplateOptions.class).to(CloudStackTemplateOptions.class);
      bind(new TypeLiteral<Function<Template, OperatingSystem>>() {
      }).to(TemplateToOperatingSystem.class);
      install(new FactoryModuleBuilder().build(StaticNATVirtualMachineInNetwork.Factory.class));
      bind(new TypeLiteral<CacheLoader<String, Set<IPForwardingRule>>>() {
      }).to(GetIPForwardingRulesByVirtualMachine.class);
      bind(new TypeLiteral<CacheLoader<String, Set<FirewallRule>>>() {
      }).to(GetFirewallRulesByVirtualMachine.class);
      bind(new TypeLiteral<CacheLoader<String, Zone>>() {
View Full Code Here

Examples of com.google.inject.assistedinject.FactoryModuleBuilder

      }).to(CreateUniqueKeyPair.class);
      bind(new TypeLiteral<Function<RegionNameAndPublicKeyMaterial, KeyPair>>() {
      }).to(ImportOrReturnExistingKeypair.class);
      bind(new TypeLiteral<CacheLoader<RegionAndName, Image>>() {
      }).to(RegionAndIdToImage.class);
      install(new FactoryModuleBuilder().build(CallForImages.Factory.class));
      bind(new TypeLiteral<Function<org.jclouds.ec2.domain.Image, Image>>() {
      }).to(EC2ImageParser.class);
      bind(new TypeLiteral<ImageExtension>() {
      }).to(EC2ImageExtension.class);
   }
View Full Code Here

Examples of com.google.inject.assistedinject.FactoryModuleBuilder

      bind(LoginCredentials.class).annotatedWith(Names.named("image")).toProvider(
            GetLoginForProviderFromPropertiesAndStoreCredentialsOrReturnNull.class);
     
      bindCredentialsOverriderFunction();
     
      install(new FactoryModuleBuilder()
            .implement(RunScriptOnNodeUsingSsh.class, Names.named("direct"), RunScriptOnNodeUsingSsh.class)
            .implement(RunScriptOnNodeAsInitScriptUsingSshAndBlockUntilComplete.class, Names.named("blocking"),
                  RunScriptOnNodeAsInitScriptUsingSshAndBlockUntilComplete.class)
            .implement(RunScriptOnNodeAsInitScriptUsingSsh.class, Names.named("nonblocking"),
                  RunScriptOnNodeAsInitScriptUsingSsh.class).build(RunScriptOnNodeFactoryImpl.Factory.class));

      install(new PersistNodeCredentialsModule());

      install(new FactoryModuleBuilder().implement(new TypeLiteral<Callable<Void>>() {
      }, CustomizeNodeAndAddToGoodMapOrPutExceptionIntoBadMap.class)
            .implement(new TypeLiteral<Function<AtomicReference<NodeMetadata>, Void>>() {
            }, CustomizeNodeAndAddToGoodMapOrPutExceptionIntoBadMap.class)
            .build(CustomizeNodeAndAddToGoodMapOrPutExceptionIntoBadMap.Factory.class));

      install(new FactoryModuleBuilder().implement(new TypeLiteral<Callable<RunScriptOnNode>>() {
      }, InitializeRunScriptOnNodeOrPlaceInBadMap.class).build(InitializeRunScriptOnNodeOrPlaceInBadMap.Factory.class));

      install(new FactoryModuleBuilder().build(BlockUntilInitScriptStatusIsZeroThenReturnOutput.Factory.class));
   }
View Full Code Here

Examples of com.google.inject.assistedinject.FactoryModuleBuilder

    final Type handlerType = Types.newParameterizedTypeWithOwner(null, OptionHandler.class, type);
    return (Key<OptionHandler<T>>) Key.get(handlerType);
  }

  public static <T> Module moduleFor(final Class<T> type, Class<? extends OptionHandler<T>> impl) {
    return new FactoryModuleBuilder()
        .implement(handlerOf(type), impl)
        .build(keyFor(type));
  }
View Full Code Here

Examples of com.google.inject.assistedinject.FactoryModuleBuilder

  }

  public static class Module extends PrivateModule {
    @Override
    public void configure() {
      install(new FactoryModuleBuilder()
          .build(AsyncReceiveCommits.Factory.class));
      expose(AsyncReceiveCommits.Factory.class);
      // Don't expose the binding for ReceiveCommits.Factory. All callers should
      // be using AsyncReceiveCommits.Factory instead.
      install(new FactoryModuleBuilder()
          .build(ReceiveCommits.Factory.class));
    }
View Full Code Here

Examples of com.google.inject.assistedinject.FactoryModuleBuilder

public class HttpContactStoreConnection implements ContactStoreConnection {
  public static Module module() {
    return new AbstractModule() {
      @Override
      protected void configure() {
        install(new FactoryModuleBuilder()
            .implement(ContactStoreConnection.class, HttpContactStoreConnection.class)
            .build(ContactStoreConnection.Factory.class));
      }
    };
  }
View Full Code Here

Examples of com.google.inject.assistedinject.FactoryModuleBuilder

   * generated to return its one return type as declared in the creation method.
   *
   * @param factory interface which specifies the bean factory method.
   */
  protected void factory(final Class<?> factory) {
    install(new FactoryModuleBuilder().build(factory));
  }
View Full Code Here

Examples of com.google.inject.assistedinject.FactoryModuleBuilder

public class MailModule extends AbstractModule {
    @Override
    protected void configure() {
        requestStaticInjection(Mail.class);
        install(new FactoryModuleBuilder().build(SendMailFactory.class));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.