org.jclouds.compute.Utils.injector()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(7.3k)|赞(0)|评价(0)|浏览(108)

本文整理了Java中org.jclouds.compute.Utils.injector()方法的一些代码示例,展示了Utils.injector()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utils.injector()方法的具体详情如下:
包路径:org.jclouds.compute.Utils
类名称:Utils
方法名:injector

Utils.injector介绍

暂无

代码示例

代码示例来源:origin: jclouds/legacy-jclouds

@Override
  protected Injector clientFrom(CloudStackContext context) {
   return context.utils().injector();
  }
}

代码示例来源:origin: jclouds/legacy-jclouds

@Override
public Injector apply(ComputeServiceContext input) {
 return input.utils().injector();
}

代码示例来源:origin: io.brooklyn/brooklyn-locations-jclouds

@Override
public void init() {
  super.init();
  ComputeServiceContext context = jcloudsParent.getComputeService().getContext();
  runScriptFactory = context.utils().injector().getInstance(RunScriptOnNode.Factory.class);
}

代码示例来源:origin: apache/jclouds

private Supplier<LoadingCache<String, Node>> supplier(ComputeServiceContext context) {
   Supplier<LoadingCache<String, Node>> supplier = context.utils().injector().getInstance(
        Key.get(new TypeLiteral<Supplier<LoadingCache<String, Node>>>() {
        }));
   return supplier;
  }
}

代码示例来源:origin: apache/jclouds

@Override
  protected Injector clientFrom(CloudStackContext context) {
   return context.utils().injector();
  }
}

代码示例来源:origin: jclouds/legacy-jclouds

@Override
@BeforeClass(groups = { "integration", "live" })
public void setupContext() {
 super.setupContext();
 Injector injector = view.utils().injector();
 tmClient = injector.getInstance(TerremarkVCloudClient.class);
 allCatalogItemsInOrg = injector.getInstance(AllCatalogItemsInOrg.class);
 parser = injector.getInstance(VAppTemplatesInOrgs.class);
}

代码示例来源:origin: jclouds/legacy-jclouds

@Override
@BeforeClass(groups = { "integration", "live" })
public void setupContext() {
 super.setupContext();
 Injector injector = view.utils().injector();
 SocketOpen socketOpen = injector.getInstance(SocketOpen.class);
 socketTester = retry(socketOpen, 300, 1, SECONDS);
 sshFactory = injector.getInstance(Factory.class);
 api = injector.getInstance(TerremarkVCloudClient.class);
}

代码示例来源:origin: jclouds/legacy-jclouds

@Test
  public void testFindCatalogIsWriteableIfNotVersion1_5() throws Exception {
   // when we are in vCloud 1.0.0 public catalogs don't work, so our default
   // catalog is private
   if (!view.utils().injector().getInstance(Key.get(String.class, ApiVersion.class)).startsWith("1.5"))
     assertTrue(getVCloudApi().getCatalogClient().findCatalogInOrgNamed(null, null).isReadOnly());
  }
}

代码示例来源:origin: jclouds/legacy-jclouds

protected Injector injectorForKnownArgumentsAndConstantPassword(Map<HttpRequest, HttpResponse> requestsResponses) {
 return computeContextForKnownArgumentsAndConstantPassword(requestsResponses).utils().injector();
}

代码示例来源:origin: jclouds/legacy-jclouds

protected void buildSocketTester() {
 SocketOpen socketOpen = view.utils().injector().getInstance(SocketOpen.class);
 socketTester = retry(socketOpen, 60, 1, SECONDS);
 // wait a maximum of 60 seconds for port 8080 to open.
 openSocketFinder = context.utils().injector().getInstance(OpenSocketFinder.class);
}

代码示例来源:origin: apache/attic-whirr

@Override
protected ClusterController createClusterController(String serviceName) {
 ClusterController controller = super.createClusterController(serviceName);
 this.dryRun = controller.getCompute().apply(clusterSpec).utils().injector().getInstance(DryRun.class).reset();
 return controller;
}

代码示例来源:origin: apache/jclouds

protected void buildSocketTester() {
 SocketOpen socketOpen = view.utils().injector().getInstance(SocketOpen.class);
 socketTester = retry(socketOpen, 60, 1, SECONDS);
 // wait a maximum of 60 seconds for port 8080 to open.
 openSocketFinder = context.utils().injector().getInstance(OpenSocketFinder.class);
}

代码示例来源:origin: apache/jclouds

protected void buildSocketTester() {
 SocketOpen socketOpen = view.utils().injector().getInstance(SocketOpen.class);
 socketTester = retry(socketOpen, 60, 1, SECONDS);
 // wait a maximum of 60 seconds for port 8080 to open.
 openSocketFinder = context.utils().injector().getInstance(OpenSocketFinder.class);
}

代码示例来源:origin: jclouds/legacy-jclouds

@BeforeClass(groups = { "integration", "live" })
public void setupContext() {
 super.setupContext();
 Injector injector = view.utils().injector();
 client = injector.getInstance(EC2Client.class);
 sshFactory = injector.getInstance(SshClient.Factory.class);
 runningTester = retry(new InstanceStateRunning(client), 180, 5,SECONDS);
 hasIpTester = retry(new InstanceHasIpAddress(client), 180, 5, SECONDS);
 SocketOpen socketOpen = injector.getInstance(SocketOpen.class);
 socketTester = retry(socketOpen, 180, 1, SECONDS);
}

代码示例来源:origin: apache/attic-whirr

protected DryRun launchWithClusterSpec(ClusterSpec clusterSpec) throws IOException, InterruptedException {
 ClusterController controller = new ClusterController();
 DryRun dryRun = controller.getCompute().apply(clusterSpec).utils().injector().getInstance(DryRun.class);
 dryRun.reset();
 controller.launchCluster(clusterSpec);
 return dryRun;
}

代码示例来源:origin: apache/jclouds

@BeforeClass(groups = { "integration", "live" })
public void setupContext() {
 super.setupContext();
 Injector injector = view.utils().injector();
 client = injector.getInstance(EC2Api.class);
 sshFactory = injector.getInstance(SshClient.Factory.class);
 runningTester = retry(new InstanceStateRunning(client), 180, 5, SECONDS);
 hasIpTester = retry(new InstanceHasIpAddress(client), 180, 5, SECONDS);
 SocketOpen socketOpen = injector.getInstance(SocketOpen.class);
 socketTester = retry(socketOpen, 180, 1, SECONDS);
}

代码示例来源:origin: apache/jclouds

@Override
protected Iterable<? extends Image> listImages() {
 AWSEC2Api client = view.unwrapApi(AWSEC2Api.class);
 String[] parts = AWSUtils.parseHandle(imageId);
 String region = parts[0];
 String imageId = parts[1];
 EC2ImageParser parser = view.utils().injector().getInstance(EC2ImageParser.class);
 return transform(
          client.getAMIApi().get().describeImagesInRegion(region, new DescribeImagesOptions().imageIds(imageId)),
    parser);
}

代码示例来源:origin: jclouds/legacy-jclouds

@Override
@BeforeClass(groups = { "integration", "live" })
public void setupContext() {
 super.setupContext();
 imageId = view.getComputeService().templateBuilder().build().getImage().getId();
    client = view.utils().injector().getInstance(ElasticStackClient.class);
 driveNotClaimed = retry(Predicates.not(new DriveClaimed(client)), maxDriveImageTime, 1, SECONDS);
 SocketOpen socketOpen = context.utils().injector().getInstance(SocketOpen.class);
 socketTester = retry(socketOpen, maxDriveImageTime, 1, SECONDS);
}

代码示例来源:origin: apache/jclouds

@Override
@BeforeClass(groups = { "integration", "live" })
public void setupContext() {
 super.setupContext();
 imageId = view.getComputeService().templateBuilder().build().getImage().getId();
    client = view.utils().injector().getInstance(ElasticStackApi.class);
 driveNotClaimed = retry(Predicates.not(new DriveClaimed(client)), maxDriveImageTime, 1, SECONDS);
 SocketOpen socketOpen = context.utils().injector().getInstance(SocketOpen.class);
 socketTester = retry(socketOpen, maxDriveImageTime, 1, SECONDS);
}

代码示例来源:origin: jclouds/legacy-jclouds

@BeforeGroups(groups = { "integration", "live" })
@Override
public void setupContext() {
 super.setupContext();
 client = view.utils().injector().getInstance(CloudSigmaClient.class);
 driveNotClaimed = retry(Predicates.not(new DriveClaimed(client)), maxDriveImageTime, 1, SECONDS);
 SocketOpen socketOpten = context.utils().injector().getInstance(SocketOpen.class);
 socketTester = retry(socketOpten, maxDriveImageTime, 1, SECONDS);
 if (template == null || template.getImageId() == null) {
   imageId = view.getComputeService().templateBuilder().build().getImage().getId();
 }
}

相关文章