public void releaseLocks(Set<Contribution> contributions) { for (Contribution contribution : contributions) { for (Deployable deployable : contribution.getManifest().getDeployables()) { QName name = deployable.getName(); if (contribution.getLockOwners().contains(name)) { contribution.releaseLock(name); } } } }
public void lock(Set<Contribution> contributions) throws CompositeAlreadyDeployedException { for (Contribution contribution : contributions) { for (Deployable deployable : contribution.getManifest().getDeployables()) { QName name = deployable.getName(); // check if the deployable has already been deployed by querying the lock owners if (contribution.getLockOwners().contains(name)) { throw new CompositeAlreadyDeployedException("Composite has already been deployed: " + name); } contribution.acquireLock(name); } } }
if (!contribution.getLockOwners().contains(deployable)) { throw new CompositeNotDeployedException("Composite is not deployed: " + deployable);
if (contribution.getLockOwners().contains(name)) { throw new CompositeAlreadyDeployedException("Composite has already been deployed: " + name); } catch (PolicyResolutionException e) { if (contribution.getLockOwners().contains(name)) { contribution.releaseLock(name); } catch (DeploymentException e) { if (contribution.getLockOwners().contains(name)) { contribution.releaseLock(name);