summaryrefslogtreecommitdiffstats
path: root/java/sca/modules
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-03-05 01:19:16 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-03-05 01:19:16 +0000
commit47044992b49585aab7b54bc02a46cb1ab46eb50e (patch)
treea0c977e121a0bb7eb7a2dec1bd358c82f35bb731 /java/sca/modules
parentc6bb4f971c2abb6bd5bdb096e87e292207eb133c (diff)
Add nonOverridable flag as defined by the oasis spec
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@750272 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules')
-rw-r--r--java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/ComponentReference.java33
-rw-r--r--java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentReferenceImpl.java9
2 files changed, 42 insertions, 0 deletions
diff --git a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/ComponentReference.java b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/ComponentReference.java
index ce40bc089b..67c1ec1409 100644
--- a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/ComponentReference.java
+++ b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/ComponentReference.java
@@ -74,6 +74,39 @@ public interface ComponentReference extends Reference {
void setCallbackService(ComponentService callbackService);
/**
+ * A boolean value, "false" by default, which indicates whether this component reference
+ * can have its targets overridden by a composite reference which promotes the
+ * component reference.
+ *
+ * If @nonOverridable==false, the target(s) of the promoting composite reference
+ * replace all the targets explicitly declared on the component reference for any
+ * value of @multiplicity on the component reference.
+ *
+ * If the component reference has @nonOverridable==false and @multiplicity 1..1
+ * and the reference has a target, then any composite reference which promotes
+ * the component reference has @multiplicity 0..1.by default and MAY have an explicit @multiplicity of either
+ * 0..1 or 1..1.
+ *
+ * If @nonOverridable==true, and the component reference has @multiplicity 0..1 or
+ * 1..1 and the component reference also declares a target, promotion implies
+ * that the promoting composite reference has @wiredbyImpl==true and the composite
+ * reference cannot supply a target, but can influence the policy attached to the
+ * component reference.
+ *
+ * If @nonOverridable==true, and the component reference @multiplicity is 0..n
+ * or 1..n, promotion targeting is additive
+ *
+ * @return
+ */
+ boolean isNonOverridable();
+
+ /**
+ * Set the nonOverridable flag
+ * @param nonOverridable
+ */
+ void setNonOverridable(boolean nonOverridable);
+
+ /**
* Returns the endpoints implied by this reference.
*
* @return the endpoints implied by this reference
diff --git a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentReferenceImpl.java b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentReferenceImpl.java
index 488023090c..9a90d7aaea 100644
--- a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentReferenceImpl.java
+++ b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentReferenceImpl.java
@@ -38,6 +38,7 @@ import org.apache.tuscany.sca.interfacedef.InterfaceContract;
public class ComponentReferenceImpl extends ReferenceImpl implements ComponentReference, Cloneable {
private Reference reference;
private Boolean autowire;
+ private boolean nonOverridable;
private List<CompositeReference> promotedAs = new ArrayList<CompositeReference>();
private ComponentService callbackService;
private List<Endpoint> endpoints = new ArrayList<Endpoint>();
@@ -109,5 +110,13 @@ public class ComponentReferenceImpl extends ReferenceImpl implements ComponentRe
interfaceContract = getInterfaceContract();
}
return interfaceContract;
+ }
+
+ public boolean isNonOverridable() {
+ return nonOverridable;
+ }
+
+ public void setNonOverridable(boolean nonOverridable) {
+ this.nonOverridable = nonOverridable;
}
}