Author: rfeng
Date: Thu Mar 5 01:39:10 2009
New Revision: 750278
URL: http://svn.apache.org/viewvc?rev=750278&view=rev
Log:
Add the @replace attribute for wire
Modified:
tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Wire.java
tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/WireImpl.java
Modified:
tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Wire.java
URL:
http://svn.apache.org/viewvc/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Wire.java?rev=750278&r1=750277&r2=750278&view=diff
==============================================================================
---
tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Wire.java
(original)
+++
tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Wire.java
Thu Mar 5 01:39:10 2009
@@ -54,6 +54,25 @@
* @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.
Modified:
tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/WireImpl.java
URL:
http://svn.apache.org/viewvc/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/WireImpl.java?rev=750278&r1=750277&r2=750278&view=diff
==============================================================================
---
tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/WireImpl.java
(original)
+++
tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/WireImpl.java
Thu Mar 5 01:39:10 2009
@@ -24,8 +24,8 @@
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 @@
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 void setRequiredIntents(List<Intent> intents) {
this.requiredIntents = intents;
}
+
+ public boolean isReplace() {
+ return replace;
+ }
+
+ public void setReplace(boolean replace) {
+ this.replace = replace;
+ }
}