Skip to content

Instantly share code, notes, and snippets.

@yaronp68
Created March 14, 2012 13:26
Show Gist options
  • Select an option

  • Save yaronp68/2036446 to your computer and use it in GitHub Desktop.

Select an option

Save yaronp68/2036446 to your computer and use it in GitHub Desktop.
public MachineDetails[] startManagementMachines(final long duration, final TimeUnit unit)
throws TimeoutException, CloudProvisioningException {
final String token = createAuthenticationToken();
final long endTime = calcEndTimeInMillis(
duration, unit);
final int numOfManagementMachines = cloud.getProvider().getNumberOfManagementMachines();
// thread pool - one per machine
final ExecutorService executor =
Executors.newFixedThreadPool(cloud.getProvider().getNumberOfManagementMachines());
try {
return doStartManagement(
endTime, token, numOfManagementMachines, executor);
} finally {
executor.shutdown();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment