ThreadExecutor exec = new ThreadExecutor(3);
// create Jclouds objects, for each IaaS
for (Cartridge cartridge : cartridges) {
// jclouds object building is time consuming, hence I use Java executor framework
exec.execute(new JcloudsObjectBuilder(cartridge, deploymentFileData));
}
exec.shutdown();
// update map
fileToCartridgeListMap.put(deploymentFileData.getAbsolutePath(),
new ArrayList<Cartridge>(cartridges));