diff options
author | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2009-03-05 01:39:10 +0000 |
---|---|---|
committer | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2009-03-05 01:39:10 +0000 |
commit | 795192db99a24c86319cd6870ecaaaac75a07a79 (patch) | |
tree | 1c676bbbc53b96cc90a3b1f687085c223a6a8e59 | |
parent | 47044992b49585aab7b54bc02a46cb1ab46eb50e (diff) |
Add the @replace attribute for wire
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@750278 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Wire.java | 19 | ||||
-rw-r--r-- | java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/WireImpl.java | 11 |
2 files changed, 29 insertions, 1 deletions
diff --git a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Wire.java b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Wire.java index 8980365bfa..e1eb26f0c1 100644 --- a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Wire.java +++ b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Wire.java @@ -54,6 +54,25 @@ public interface Wire extends Base, Extensible, PolicySubject, Cloneable { * @param target the target of the wire */ void setTarget(ComponentService target); + + /** + * A boolean value, with the default of "false". When a wire element has + * @replace="false", the wire is added to the set of wires which apply to + * the reference identified by the @source attribute. When a wire element + * has @replace="true", the wire is added to the set of wires which apply to + * the reference identified by the @source attribute - but any wires for that + * reference specified by means of the @target attribute of the reference + * are removed from the set of wires which apply to the reference. + * + * @return + */ + boolean isReplace(); + + /** + * Set the replace flag for the wire + * @param replace + */ + void setReplace(boolean replace); /** * Returns a clone of the wire. diff --git a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/WireImpl.java b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/WireImpl.java index 99ed9b6d10..9f8af0907d 100644 --- a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/WireImpl.java +++ b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/WireImpl.java @@ -24,8 +24,8 @@ import java.util.List; import org.apache.tuscany.sca.assembly.ComponentReference; import org.apache.tuscany.sca.assembly.ComponentService; import org.apache.tuscany.sca.assembly.Wire; -import org.apache.tuscany.sca.policy.Intent; import org.apache.tuscany.sca.policy.ExtensionType; +import org.apache.tuscany.sca.policy.Intent; import org.apache.tuscany.sca.policy.PolicySet; /** @@ -36,6 +36,7 @@ import org.apache.tuscany.sca.policy.PolicySet; public class WireImpl extends ExtensibleImpl implements Wire, Cloneable { private ComponentReference source; private ComponentService target; + private boolean replace; private List<Intent> requiredIntents = new ArrayList<Intent>(); private List<PolicySet> policySets = new ArrayList<PolicySet>(); private List<PolicySet> applicablePolicySets = new ArrayList<PolicySet>(); @@ -93,4 +94,12 @@ public class WireImpl extends ExtensibleImpl implements Wire, Cloneable { public void setRequiredIntents(List<Intent> intents) { this.requiredIntents = intents; } + + public boolean isReplace() { + return replace; + } + + public void setReplace(boolean replace) { + this.replace = replace; + } } |