diff options
-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; + } } |