You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by an...@apache.org on 2010/05/26 22:05:38 UTC
svn commit: r948564 - in
/tuscany/sca-java-2.x/trunk/modules/deployment/src/main/java/org/apache/tuscany/sca/deployment:
Deployer.java impl/DeployerImpl.java
Author: antelder
Date: Wed May 26 20:05:38 2010
New Revision: 948564
URL: http://svn.apache.org/viewvc?rev=948564&view=rev
Log:
Update Deployer.attachDeploymentComposite to return the URI of the attached composite
Modified:
tuscany/sca-java-2.x/trunk/modules/deployment/src/main/java/org/apache/tuscany/sca/deployment/Deployer.java
tuscany/sca-java-2.x/trunk/modules/deployment/src/main/java/org/apache/tuscany/sca/deployment/impl/DeployerImpl.java
Modified: tuscany/sca-java-2.x/trunk/modules/deployment/src/main/java/org/apache/tuscany/sca/deployment/Deployer.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/deployment/src/main/java/org/apache/tuscany/sca/deployment/Deployer.java?rev=948564&r1=948563&r2=948564&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/deployment/src/main/java/org/apache/tuscany/sca/deployment/Deployer.java (original)
+++ tuscany/sca-java-2.x/trunk/modules/deployment/src/main/java/org/apache/tuscany/sca/deployment/Deployer.java Wed May 26 20:05:38 2010
@@ -66,12 +66,14 @@ public interface Deployer extends LifeCy
* @param contribution The target contribution
* @param composite The deployment composite
* @param appending A flag to indicate if existing deployable composites in the contribution should be appended or replaced
+ * @return uri of attached composite
*/
- void attachDeploymentComposite(Contribution contribution, Composite composite, boolean appending);
+ String attachDeploymentComposite(Contribution contribution, Composite composite, boolean appending);
/**
* Configure a list of contributions to create a composite representing a view of the domain
* @param contributions
+ * @param allContributions
* @param bindingBaseURIs
* @param monitor
* @return
Modified: tuscany/sca-java-2.x/trunk/modules/deployment/src/main/java/org/apache/tuscany/sca/deployment/impl/DeployerImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/deployment/src/main/java/org/apache/tuscany/sca/deployment/impl/DeployerImpl.java?rev=948564&r1=948563&r2=948564&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/deployment/src/main/java/org/apache/tuscany/sca/deployment/impl/DeployerImpl.java (original)
+++ tuscany/sca-java-2.x/trunk/modules/deployment/src/main/java/org/apache/tuscany/sca/deployment/impl/DeployerImpl.java Wed May 26 20:05:38 2010
@@ -423,14 +423,25 @@ public class DeployerImpl implements Dep
return contribution;
}
- public void attachDeploymentComposite(Contribution contribution, Composite composite, boolean appending) {
+ public String attachDeploymentComposite(Contribution contribution, Composite composite, boolean appending) {
init();
+
+ String compositeArtifactURI = composite.getName().getLocalPart() + ".composite";
+
+ if (appending) {
+ // check its not already there
+ for (Artifact a : contribution.getArtifacts()) {
+ if (compositeArtifactURI.equals(a.getURI())) {
+ throw new IllegalStateException("artifact '" + compositeArtifactURI + "' already exists in contribution: " + contribution.getURI());
+ }
+ }
+ }
+
// Create an artifact for the deployment composite
Artifact artifact = contributionFactory.createArtifact();
- String uri = composite.getName().getLocalPart() + ".composite";
- artifact.setURI(uri);
+ artifact.setURI(compositeArtifactURI);
- artifact.setLocation(uri);
+ artifact.setLocation(compositeArtifactURI);
artifact.setModel(composite);
artifact.setUnresolved(false);
// Add it to the contribution
@@ -442,6 +453,7 @@ public class DeployerImpl implements Dep
contribution.getDeployables().clear();
}
contribution.getDeployables().add(composite);
+ return compositeArtifactURI;
}
public Composite build(List<Contribution> contributions, List<Contribution> allContributions, Map<QName, List<String>> bindingMap, Monitor monitor)