Package org.jclouds.compute

Examples of org.jclouds.compute.ComputeServiceContextFactory


    Configuration jcloudsConfig =
      spec.getConfigurationForKeysWithPrefix("jclouds");
    Set<AbstractModule> wiring = ImmutableSet.of(new JschSshClientModule(),
      new Log4JLoggingModule());

    return new ComputeServiceContextFactory().createContext(spec.getProvider(),
      spec.getIdentity(), spec.getCredential(),
      wiring, ConfigurationConverter.getProperties(jcloudsConfig));
  }
View Full Code Here


  public static ComputeServiceContext build(ClusterSpec spec) throws IOException {
    Set<AbstractModule> wiring = ImmutableSet.of(new JschSshClientModule(),
      new Log4JLoggingModule());

    ComputeServiceContext context = new ComputeServiceContextFactory()
      .createContext(spec.getProvider(), spec.getIdentity(), spec.getCredential(),
        wiring);

    return context;
  }
View Full Code Here

        overrides.setProperty(AWSEC2Constants.PROPERTY_EC2_CC_AMI_QUERY, "");

        // Inject the SSH implementation
        Iterable<Module> modules = ImmutableSet.<Module>of(new SshjSshClientModule());

        return new ComputeServiceContextFactory().createContext(provider.getComputeId(),
                cloudProperties.getString("nodeable.aws.accessKeyId"), cloudProperties.getString("nodeable.aws.secretKey"), modules,
                overrides).getComputeService();
    }
View Full Code Here

    private ComputeServiceContext m_computeServiceContext;
   
    public void start() {
        Properties props = new Properties();
        props.put(EC2Constants.PROPERTY_EC2_AMI_OWNERS, "");
        m_computeServiceContext = new ComputeServiceContextFactory().createContext("aws-ec2",
                m_accessKeyId, m_secretAccessKey, (List) Arrays.asList(new JschSshClientModule()), props);
    }
View Full Code Here

      String secretkey = args[1];
      String group = args[2];
      String command = args[3];

      // Init
      ComputeService compute = new ComputeServiceContextFactory().createContext("aws-ec2", accesskeyid, secretkey)
               .getComputeService();

      // wait up to 60 seconds for ssh to be accessible
      RetryablePredicate<IPSocket> socketTester = new RetryablePredicate<IPSocket>(new InetSocketAddressConnect(), 60,
               1, 1, TimeUnit.SECONDS);
View Full Code Here

   @Test
   public void testAndExperiment() {
      ComputeServiceContext context = null;
      try {
         context = new ComputeServiceContextFactory().createContext(new LibvirtComputeServiceContextSpec(
               "qemu:///system", "identity", "credential"));
        
        
         /*
          * /* System.out.println("images " + context.getComputeService().listImages());
View Full Code Here

      return new JschSshClientModule();
   }

   public void testAssignability() throws Exception {
      @SuppressWarnings("unused")
      RestContext<Connect, Connect> goGridContext = new ComputeServiceContextFactory().createContext(provider,
            identity, credential).getProviderSpecificContext();
   }
View Full Code Here

@Test(groups = "unit")
public class LibvirtComputeServiceContextBuilderTest {

   @Test
   public void testCanBuildWithComputeService() {
      ComputeServiceContext context = new ComputeServiceContextFactory()
            .createContext(new LibvirtComputeServiceContextSpec("test:///default", "identity", "credential"));
      // System.err.println(context.getComputeService().
      context.close();
   }
View Full Code Here

      Properties restProperties = new Properties();
      restProperties.setProperty("libvirt.contextbuilder", LibvirtComputeServiceContextBuilder.class.getName());
      restProperties.setProperty("libvirt.propertiesbuilder", LibvirtPropertiesBuilder.class.getName());
      restProperties.setProperty("libvirt.endpoint", "test:///default");

      ComputeServiceContext context = new ComputeServiceContextFactory(restProperties).createContext("libvirt",
            "identity", "credential");

      context.close();
   }
View Full Code Here

      Properties restProperties = new Properties();
      restProperties.setProperty("libvirt.contextbuilder", LibvirtComputeServiceContextBuilder.class.getName());
      restProperties.setProperty("libvirt.propertiesbuilder", LibvirtPropertiesBuilder.class.getName());
      restProperties.setProperty("libvirt.endpoint", "test:///default");

      ComputeServiceContext context = new ComputeServiceContextFactory(restProperties).createContext("libvirt",
            "identity", "credential");
     
      RestContext<Connect, Connect> providerContext = context.getProviderSpecificContext();

      assertEquals(providerContext.getApi().getClass(), Connect.class);
View Full Code Here

TOP

Related Classes of org.jclouds.compute.ComputeServiceContextFactory

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.