/** * loads the provisioning driver class and sets it up. * * @throws CLIException Indicates the configured could not be found and instantiated */ private void createProvisioningDriver() throws CLIException { try { provisioning = (ProvisioningDriver) Class.forName(cloud.getConfiguration().getClassName()).newInstance(); } catch (final ClassNotFoundException e) { throw new CLIException( "Failed to load provisioning class for cloud: " + cloud.getName() + ". Class not found: " + cloud.getConfiguration().getClassName(), e); } catch (final Exception e) { throw new CLIException("Failed to load provisioning class for cloud: " + cloud.getName(), e); } if (provisioning instanceof ProvisioningDriverClassContextAware) { final ProvisioningDriverClassContextAware contextAware = (ProvisioningDriverClassContextAware) provisioning; contextAware.setProvisioningDriverClassContext(new DefaultProvisioningDriverClassContext()); } provisioning.addListener(new CliProvisioningDriverListener()); final String serviceName = null; provisioning.setConfig( cloud, cloud.getConfiguration().getManagementMachineTemplate(), true, serviceName); }