diff options
Diffstat (limited to 'java/sca/modules')
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; } } |