/** * Allocates and deploys new components in the domain. * * @param domain the domain component * @param plan the deployment plan * @throws DeploymentException if an error is encountered during deployment */ private void allocateAndDeploy(LogicalCompositeComponent domain, DeploymentPlan plan) throws DeploymentException { // Allocate the components to runtime nodes try { allocate(domain, plan); } catch (AllocationException e) { throw new DeploymentException("Error deploying composite", e); } // Select bindings selectBinding(domain); try { // generate and provision any new components and new wires Deployment deployment = generator.generate(domain, true); collector.markAsProvisioned(domain); Deployment fullDeployment = null; if (generateFullDeployment) { fullDeployment = generator.generate(domain, false); } DeploymentPackage deploymentPackage = new DeploymentPackage(deployment, fullDeployment); deployer.deploy(deploymentPackage); } catch (GenerationException e) { throw new DeploymentException("Error deploying components", e); } }
allocate(domain, plan); selectBinding(domain); collector.markAsProvisioned(domain);