/** * Cast to VirtualDeploymentRepositoryExt * * @param profile the mutable profile * @return the virtual deployment repository */ static VirtualDeploymentRepository resolveDeploymentRepository(MutableProfile profile) { if(profile instanceof VirtualDeploymentRepositoryExt == false) { throw new IllegalStateException("Failed to get the deployment repository for profile " + profile.getKey()); } return VirtualDeploymentRepositoryExt.class.cast(profile).getDeploymentRepository(); }
protected void doRollbackFromPrepared() { final String name = getDeploymentName(); if(getProfile().hasDeployment(name)) { try { getProfile().removeDeployment(name); } catch(Exception e) { log.error("failed to rollback changes " + name); } } }
if(getProfile().hasDeployment(deploymentName)) ProfileDeployment deployment = getProfile().getDeployment(deploymentName); deployment.getDeploymentInfo().setFlag(ProfileDeploymentFlag.LOCKED); getProfile().addDeployment(deployment); response.fireModificationEvent(ProfileModificationEvent.create(ProfileModificationType.ADD, getProfile().getKey()));
if(getProfile().hasDeployment(deploymentName)) ProfileDeployment deployment = getProfile().getDeployment(deploymentName); deployment.getDeploymentInfo().setFlag(ProfileDeploymentFlag.LOCKED); ProfileKey key = getProfile().getKey(); String profileName = key.getName(); String repoDeploymentName = createDeploymentName(vf); response.fireModificationEvent(ProfileModificationEvent.create(ProfileModificationType.ADD, getProfile().getKey()));
final ProfileDeployment deployment = profile.getDeployment(deploymentName); profile.removeDeployment(deployment.getName());
protected boolean doPrepare(ProfileModificationResponse response) { try { final String name = getDeploymentName(); final URL url = getDeploymentID().getContentURL(); if(url == null) { return false; } // final VirtualFile vf = VFS.getChild(url); // Create the deployment directly final ProfileDeployment deployment = deploymentFactory.createDeployment(vf, new TransientDeploymentMetaData(name)); deployment.getDeploymentInfo().setFlag(ProfileDeploymentFlag.LOCKED); // Attach original deployment url for resolving deployment names deployment.getTransientAttachments().putAttachment(TransientProfileActivator.TRANSIENT_DEPLOYMENT_URL_KEY, url.toExternalForm()); getProfile().addDeployment(deployment); // Notify response.fireModificationEvent(ProfileModificationEvent.create(ProfileModificationType.ADD, getProfile().getKey())); } catch(Exception e) { response.setFailure(e); return false; } return true; }