本文整理了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 extends SecurityGroupApi> 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);
}