/** * Include all deployables contained in the list of contributions in the domain. * * @param uris the contributions to deploy * @param recover true if this is a recovery operation * @throws Fabric3Exception if an error is encountered during inclusion */ private synchronized void include(List<URI> uris, boolean recover) throws Fabric3Exception { Set<Contribution> contributions = contributionHelper.findContributions(uris); List<Composite> deployables = contributionHelper.getDeployables(contributions); instantiateAndDeploy(deployables, contributions, recover); }
public synchronized void include(List<URI> uris) throws DeploymentException { Set<Contribution> contributions = contributionHelper.findContributions(uris); List<Composite> deployables = contributionHelper.getDeployables(contributions); if (RuntimeMode.CONTROLLER == info.getRuntimeMode() && !isLocal()) { Map<URI, DeploymentPlan> plans = new HashMap<URI, DeploymentPlan>(); for (Contribution contribution : contributions) { URI uri = contribution.getUri(); DeploymentPlan defaultPlan = contributionHelper.findDefaultPlan(contribution); if (defaultPlan == null) { defaultPlan = SYNTHETIC_PLAN;
if (RuntimeMode.CONTROLLER == info.getRuntimeMode()) { plan = contributionHelper.findDefaultPlan(deployable); if (plan == null) { plan = SYNTHETIC_PLAN; plan = contributionHelper.findPlan(planName); if (plan == null) { plan = SYNTHETIC_PLAN; List<Composite> deployableComposites = contributionHelper.getDeployables(contributions); instantiateAndDeploy(deployableComposites, contributions, merged, true);
public synchronized void include(QName deployable, String planName) throws DeploymentException { Composite wrapper = createWrapper(deployable); DeploymentPlan plan; if (planName == null) { if (RuntimeMode.CONTROLLER == info.getRuntimeMode() && !isLocal()) { plan = contributionHelper.findDefaultPlan(deployable); if (plan == null) { plan = SYNTHETIC_PLAN; } } else { plan = SYNTHETIC_PLAN; } } else { // plan specified plan = contributionHelper.findPlan(planName); if (plan == null) { throw new DeploymentPlanNotFoundException("Deployment plan not found: " + planName); } } for (DeployListener listener : listeners) { listener.onDeploy(deployable, plan.getName()); } instantiateAndDeploy(wrapper, plan, false); for (DeployListener listener : listeners) { listener.onDeployCompleted(deployable, plan.getName()); } }
contributionHelper.lock(contributions); try { if (isTransactional()) { contributionHelper.releaseLocks(contributions); throw new AssemblyException(context.getErrors()); contributionHelper.releaseLocks(contributions); throw e; } catch (AllocationException e) { contributionHelper.releaseLocks(contributions); throw new DeploymentException("Error deploying composite", e); } catch (PolicyResolutionException e) { contributionHelper.releaseLocks(contributions); throw new DeploymentException("Error deploying composite", e);
/** * Creates a wrapper used to include a composite at the domain level. The wrapper is thrown away during the inclusion. * * @param deployable the deployable being included * @return the composite wrapper * @throws DeploymentException if there is an error creating the composite wrapper */ private Composite createWrapper(QName deployable) throws DeploymentException { Composite composite = contributionHelper.findComposite(deployable); // In order to include a composite at the domain level, it must first be wrapped in a composite that includes it. // This wrapper is thrown away during the inclusion. Composite wrapper = new Composite(deployable); Include include = new Include(); include.setName(deployable); include.setIncluded(composite); wrapper.add(include); return wrapper; }
/** * Include all deployables contained in the list of contributions in the domain. * * @param uris the contributions to deploy * @param recover true if this is a recovery operation * @throws Fabric3Exception if an error is encountered during inclusion */ private synchronized void include(List<URI> uris, boolean recover) throws Fabric3Exception { Set<Contribution> contributions = contributionHelper.findContributions(uris); List<Composite> deployables = contributionHelper.getDeployables(contributions); instantiateAndDeploy(deployables, contributions, recover); }