热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

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

本文整理了Java中org.jclouds.compute.ComputeService.getContext()方法的一些代码示例,展示了ComputeS

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

ComputeService.getContext介绍

暂无

代码示例

代码示例来源:origin: org.jclouds.karaf/core

/**
* @return a reference to the context that created this ComputeService.
*/
@Override
public ComputeServiceContext getContext() {
return computeService.getContext();
}

代码示例来源:origin: org.apache.jclouds.karaf/core

/**
* @return a reference to the context that created this ComputeService.
*/
@Override
public ComputeServiceContext getContext() {
return computeService.getContext();
}

代码示例来源:origin: org.cloudml/deployer

/**
* Close the connection
*/
public void closeConnection(){
compute.getContext().close();
journal.log(Level.INFO, ">> Closing connection ...");
}

代码示例来源:origin: com.hazelcast/hazelcast-jclouds

public void destroy() {
if (computeService != null) {
this.computeService.getContext().close();
}
}

代码示例来源:origin: SINTEF-9012/cloudml

/**
* Close the connection
*/
public void closeConnection(){
compute.getContext().close();
journal.log(Level.INFO, ">> Closing connection ...");
}

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

public synchronized void bind(ComputeService computeService) {
if (computeService != null) {
serviceContextMap.put(computeService.getContext().unwrap().getName(), computeService.getContext());
}
}

代码示例来源:origin: org.apache.whirr/whirr-core

public synchronized void bind(ComputeService computeService) {
if (computeService != null) {
serviceContextMap.put(computeService.getContext().unwrap().getName(), computeService.getContext());
}
}

代码示例来源:origin: io.fabric8/fabric-core-agent-jclouds

void bindComputeService(ComputeService computeService) {
String name = computeService.getContext().unwrap().getName();
if (name != null) {
computeServiceMap.put(name, computeService);
}
}

代码示例来源:origin: io.fabric8/fabric-core-agent-jclouds

void unbindComputeService(ComputeService computeService) {
String serviceId = computeService.getContext().unwrap().getName();
if (serviceId != null) {
computeServiceMap.remove(serviceId);
}
}
}

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

public synchronized void unbind(ComputeService computeService) {
if (computeService != null) {
serviceContextMap.remove(computeService.getContext().unwrap().getName());
}
}
}

代码示例来源:origin: io.fabric8/fabric-core-agent-jclouds

/**
* Returns the @{link SecurityGroupApi} for the target location.
*/
private static Optional getSecurityGroup(ComputeService computeService, String location) {
return computeService.getContext().unwrapApi(NovaApi.class)
.getSecurityGroupExtensionForZone(location);
}

代码示例来源:origin: org.apache.jclouds.karaf/commands

@Override
public String getCacheableKey(ComputeService type) {
return type.getContext().unwrap().getName();
}
}

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

private void assertComputeServiceType(JcloudsLocation loc, String expectedType) {
// TODO Would be nice to do this more explicitly, rather than relying on toString.
// But this is good enough.
ComputeService computeService = loc.getComputeService();
ComputeServiceContext cOntext= computeService.getContext();
assertTrue(context.toString().contains("id="+expectedType), "computeService="+computeService+"; cOntext="+computeService.getContext());
}

代码示例来源:origin: io.fabric8/fabric-core-agent-jclouds

@Override
public int complete(String buffer, int cursor, List candidates) {
delegate.getStrings().clear();
if (computeServices != null && !computeServices.isEmpty()) {
for(ComputeService computeService:computeServices) {
delegate.getStrings().add(computeService.getContext().unwrap().getId());
}
}
return delegate.complete(buffer, cursor, candidates);
}

代码示例来源:origin: io.fabric8/fabric-core-agent-jclouds

void bindComputeService(ComputeService computeService) {
String name = computeService.getContext().unwrap().getName();
if (!Strings.isEmpty(name)) {
computeServices.putIfAbsent(name, new DynamicReference(name, COMPUTE_SERVICE_WAIT, TimeUnit.MILLISECONDS));
computeServices.get(name).bind(computeService);
}
}

代码示例来源:origin: io.fabric8/fabric-core-agent-jclouds

void unbindComputeService(ComputeService computeService) {
String name = computeService.getContext().unwrap().getName();
if (!Strings.isEmpty(name)) {
DynamicReference ref = computeServices.get(name);
if (ref != null) {
ref.unbind(computeService);
}
}
}
}

代码示例来源:origin: com.hazelcast.simulator/simulator

void shutdown() {
echo("Shutting down Provisioner...");
// shutdown thread pool
executor.shutdown();
awaitTermination(executor, EXECUTOR_TERMINATION_TIMEOUT_SECONDS, SECONDS);
// shutdown compute service (which holds another thread pool)
if (computeService != null) {
computeService.getContext().close();
}
echo("Done!");
}

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

@BeforeMethod(alwaysRun=true)
public void setUp() throws Exception {
MockitoAnnotations.initMocks(this);

// stock mock responses
when(computeService.getContext()).thenReturn(computeServiceContext);
when(computeServiceContext.unwrapApi(AzureComputeApi.class)).thenReturn(azureComputeApi);
when(azureComputeApi.getResourceGroupApi()).thenReturn(resourceGroupApi);
when(azureComputeApi.getSubnetApi(TEST_RESOURCE_GROUP, TEST_NETWORK_NAME)).thenReturn(subnetApi);
when(azureComputeApi.getVirtualNetworkApi(TEST_RESOURCE_GROUP)).thenReturn(virtualNetworkApi);
when(subnet.id()).thenReturn(TEST_SUBNET_ID);
}

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

protected Set getAvailabilityZones() {
String regiOnName= loc.getRegion();
AWSEC2Client ec2Client = loc.getComputeService().getContext().unwrap(AWSEC2ApiMetadata.CONTEXT_TOKEN).getApi();
return ec2Client.getAvailabilityZoneAndRegionServices().describeAvailabilityZonesInRegion(regionName);
}

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

@Test
public void testSessionRefresh() throws Exception {
VCloudClient cOnnection= VCloudClient.class.cast(client.getContext().unwrap(VCloudApiMetadata.CONTEXT_TOKEN)
.getApi());
connection.getOrgClient().findOrgNamed(null);
Thread.sleep(timeOut * 1000);
connection.getOrgClient().findOrgNamed(null);
}

推荐阅读
  • 在Android开发中,使用Picasso库可以实现对网络图片的等比例缩放。本文介绍了使用Picasso库进行图片缩放的方法,并提供了具体的代码实现。通过获取图片的宽高,计算目标宽度和高度,并创建新图实现等比例缩放。 ... [详细]
  • 标题: ... [详细]
  • 重入锁(ReentrantLock)学习及实现原理
    本文介绍了重入锁(ReentrantLock)的学习及实现原理。在学习synchronized的基础上,重入锁提供了更多的灵活性和功能。文章详细介绍了重入锁的特性、使用方法和实现原理,并提供了类图和测试代码供读者参考。重入锁支持重入和公平与非公平两种实现方式,通过对比和分析,读者可以更好地理解和应用重入锁。 ... [详细]
  • Activiti7流程定义开发笔记
    本文介绍了Activiti7流程定义的开发笔记,包括流程定义的概念、使用activiti-explorer和activiti-eclipse-designer进行建模的方式,以及生成流程图的方法。还介绍了流程定义部署的概念和步骤,包括将bpmn和png文件添加部署到activiti数据库中的方法,以及使用ZIP包进行部署的方式。同时还提到了activiti.cfg.xml文件的作用。 ... [详细]
  • Iamtryingtomakeaclassthatwillreadatextfileofnamesintoanarray,thenreturnthatarra ... [详细]
  • Spring特性实现接口多类的动态调用详解
    本文详细介绍了如何使用Spring特性实现接口多类的动态调用。通过对Spring IoC容器的基础类BeanFactory和ApplicationContext的介绍,以及getBeansOfType方法的应用,解决了在实际工作中遇到的接口及多个实现类的问题。同时,文章还提到了SPI使用的不便之处,并介绍了借助ApplicationContext实现需求的方法。阅读本文,你将了解到Spring特性的实现原理和实际应用方式。 ... [详细]
  • 本文讨论了一个关于cuowu类的问题,作者在使用cuowu类时遇到了错误提示和使用AdjustmentListener的问题。文章提供了16个解决方案,并给出了两个可能导致错误的原因。 ... [详细]
  • XML介绍与使用的概述及标签规则
    本文介绍了XML的基本概念和用途,包括XML的可扩展性和标签的自定义特性。同时还详细解释了XML标签的规则,包括标签的尖括号和合法标识符的组成,标签必须成对出现的原则以及特殊标签的使用方法。通过本文的阅读,读者可以对XML的基本知识有一个全面的了解。 ... [详细]
  • 利用Visual Basic开发SAP接口程序初探的方法与原理
    本文介绍了利用Visual Basic开发SAP接口程序的方法与原理,以及SAP R/3系统的特点和二次开发平台ABAP的使用。通过程序接口自动读取SAP R/3的数据表或视图,在外部进行处理和利用水晶报表等工具生成符合中国人习惯的报表样式。具体介绍了RFC调用的原理和模型,并强调本文主要不讨论SAP R/3函数的开发,而是针对使用SAP的公司的非ABAP开发人员提供了初步的接口程序开发指导。 ... [详细]
  • 使用圣杯布局模式实现网站首页的内容布局
    本文介绍了使用圣杯布局模式实现网站首页的内容布局的方法,包括HTML部分代码和实例。同时还提供了公司新闻、最新产品、关于我们、联系我们等页面的布局示例。商品展示区包括了车里子和农家生态土鸡蛋等产品的价格信息。 ... [详细]
  • 本文介绍了pack布局管理器在Perl/Tk中的使用方法及注意事项。通过调用pack()方法,可以控制部件在显示窗口中的位置和大小。同时,本文还提到了在使用pack布局管理器时,应注意将部件分组以便在水平和垂直方向上进行堆放。此外,还介绍了使用Frame部件或Toplevel部件来组织部件在窗口内的方法。最后,本文强调了在使用pack布局管理器时,应避免在中间切换到grid布局管理器,以免造成混乱。 ... [详细]
  • Iamtryingtocreateanarrayofstructinstanceslikethis:我试图创建一个这样的struct实例数组:letinstallers: ... [详细]
  • 大数据Hadoop生态(20)MapReduce框架原理OutputFormat的开发笔记
    本文介绍了大数据Hadoop生态(20)MapReduce框架原理OutputFormat的开发笔记,包括outputFormat接口实现类、自定义outputFormat步骤和案例。案例中将包含nty的日志输出到nty.log文件,其他日志输出到other.log文件。同时提供了一些相关网址供参考。 ... [详细]
  • Sleuth+zipkin链路追踪SpringCloud微服务的解决方案
    在庞大的微服务群中,随着业务扩展,微服务个数增多,系统调用链路复杂化。Sleuth+zipkin是解决SpringCloud微服务定位和追踪的方案。通过TraceId将不同服务调用的日志串联起来,实现请求链路跟踪。通过Feign调用和Request传递TraceId,将整个调用链路的服务日志归组合并,提供定位和追踪的功能。 ... [详细]
  • 本文介绍了解决java开源项目apache commons email简单使用报错的方法,包括使用正确的JAR包和正确的代码配置,以及相关参数的设置。详细介绍了如何使用apache commons email发送邮件。 ... [详细]
author-avatar
mobiledu2502891657
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有