diff options
Diffstat (limited to 'java')
4 files changed, 84 insertions, 40 deletions
diff --git a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Endpoint2.java b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Endpoint2.java index bcc5adf30a..d99d4f6450 100644 --- a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Endpoint2.java +++ b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Endpoint2.java @@ -18,9 +18,8 @@ */ package org.apache.tuscany.sca.assembly; -import java.util.List; - import org.apache.tuscany.sca.interfacedef.InterfaceContract; +import org.apache.tuscany.sca.policy.PolicySubject; /** * Represents a service endpoint which is what results from having a configured @@ -30,7 +29,7 @@ import org.apache.tuscany.sca.interfacedef.InterfaceContract; * * @version $Rev$ $Date$ */ -public interface Endpoint2 extends Base, Cloneable { +public interface Endpoint2 extends Base, PolicySubject, Cloneable { /** * Get the component model object diff --git a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/EndpointReference2.java b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/EndpointReference2.java index d43274ad6c..7e4898507a 100644 --- a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/EndpointReference2.java +++ b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/EndpointReference2.java @@ -18,9 +18,8 @@ */ package org.apache.tuscany.sca.assembly; -import java.util.List; - import org.apache.tuscany.sca.interfacedef.InterfaceContract; +import org.apache.tuscany.sca.policy.PolicySubject; /** * Represents an endpoint reference. An SCA reference can reference service enpoints in a @@ -29,7 +28,7 @@ import org.apache.tuscany.sca.interfacedef.InterfaceContract; * * @version $Rev$ $Date$ */ -public interface EndpointReference2 extends Base, Cloneable { +public interface EndpointReference2 extends Base, PolicySubject, Cloneable { /** * Get the name of the target service that this endpoint reference refers to diff --git a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/Endpoint2Impl.java b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/Endpoint2Impl.java index 79b30793f0..b5dac5a284 100644 --- a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/Endpoint2Impl.java +++ b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/Endpoint2Impl.java @@ -23,11 +23,13 @@ import java.util.List; import org.apache.tuscany.sca.assembly.Binding; import org.apache.tuscany.sca.assembly.Component; -import org.apache.tuscany.sca.assembly.ComponentReference; import org.apache.tuscany.sca.assembly.ComponentService; -import org.apache.tuscany.sca.assembly.Endpoint; import org.apache.tuscany.sca.assembly.Endpoint2; import org.apache.tuscany.sca.interfacedef.InterfaceContract; +import org.apache.tuscany.sca.policy.ExtensionType; +import org.apache.tuscany.sca.policy.Intent; +import org.apache.tuscany.sca.policy.PolicySet; +import org.apache.tuscany.sca.policy.PolicySubject; /** * The assembly model object for an endpoint. @@ -35,17 +37,19 @@ import org.apache.tuscany.sca.interfacedef.InterfaceContract; * @version $Rev$ $Date$ */ public class Endpoint2Impl implements Endpoint2 { - + private Component component; private ComponentService service; private Binding binding; - private Binding callbackBinding; + private Binding callbackBinding; private InterfaceContract interfaceContract; private String uri; - + private List<PolicySet> policySets = new ArrayList<PolicySet>(); + private List<Intent> requiredIntents = new ArrayList<Intent>(); + protected Endpoint2Impl() { } - + @Override public Object clone() throws CloneNotSupportedException { return super.clone(); @@ -55,11 +59,11 @@ public class Endpoint2Impl implements Endpoint2 { // TODO Auto-generated method stub return false; } - + public void setUnresolved(boolean unresolved) { // TODO Auto-generated method stub } - + public Component getComponent() { return component; } @@ -74,29 +78,48 @@ public class Endpoint2Impl implements Endpoint2 { public void setService(ComponentService service) { this.service = service; - } - + } + public Binding getBinding() { return binding; } public void setBinding(Binding binding) { this.binding = binding; - } - + } + public InterfaceContract getInterfaceContract() { return interfaceContract; } - + public void setInterfaceContract(InterfaceContract interfaceContract) { this.interfaceContract = interfaceContract; } - + public String getURI() { return uri; } - + public void setURI(String uri) { this.uri = uri; } + + public List<PolicySet> getPolicySets() { + return policySets; + } + + public List<Intent> getRequiredIntents() { + return requiredIntents; + } + + public ExtensionType getType() { + if (binding instanceof PolicySubject) { + return ((PolicySubject)binding).getType(); + } + return null; + } + + public void setType(ExtensionType type) { + throw new UnsupportedOperationException(); + } } diff --git a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/EndpointReference2Impl.java b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/EndpointReference2Impl.java index 75ed86b8d4..ceeba3ceb0 100644 --- a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/EndpointReference2Impl.java +++ b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/EndpointReference2Impl.java @@ -24,11 +24,13 @@ import java.util.List; import org.apache.tuscany.sca.assembly.Binding; import org.apache.tuscany.sca.assembly.Component; import org.apache.tuscany.sca.assembly.ComponentReference; -import org.apache.tuscany.sca.assembly.ComponentService; -import org.apache.tuscany.sca.assembly.Endpoint; import org.apache.tuscany.sca.assembly.Endpoint2; import org.apache.tuscany.sca.assembly.EndpointReference2; import org.apache.tuscany.sca.interfacedef.InterfaceContract; +import org.apache.tuscany.sca.policy.ExtensionType; +import org.apache.tuscany.sca.policy.Intent; +import org.apache.tuscany.sca.policy.PolicySet; +import org.apache.tuscany.sca.policy.PolicySubject; /** * The assembly model object for an endpoint. @@ -36,7 +38,7 @@ import org.apache.tuscany.sca.interfacedef.InterfaceContract; * @version $Rev$ $Date$ */ public class EndpointReference2Impl implements EndpointReference2 { - + private String targetName; private Component component; private ComponentReference reference; @@ -45,29 +47,31 @@ public class EndpointReference2Impl implements EndpointReference2 { private Endpoint2 endpoint; private InterfaceContract interfaceContract; private String uri; - + private List<PolicySet> policySets = new ArrayList<PolicySet>(); + private List<Intent> requiredIntents = new ArrayList<Intent>(); + protected EndpointReference2Impl() { } - + @Override public Object clone() throws CloneNotSupportedException { return super.clone(); } - + public boolean isUnresolved() { // TODO Auto-generated method stub return false; } - + public void setUnresolved(boolean unresolved) { // TODO Auto-generated method stub } - - public String getTargetName(){ + + public String getTargetName() { return targetName; } - - public void setTargetName(String targetName){ + + public void setTargetName(String targetName) { this.targetName = targetName; } @@ -85,8 +89,8 @@ public class EndpointReference2Impl implements EndpointReference2 { public void setReference(ComponentReference reference) { this.reference = reference; - } - + } + public Binding getBinding() { return binding; } @@ -98,24 +102,43 @@ public class EndpointReference2Impl implements EndpointReference2 { public Endpoint2 getEndpoint() { return endpoint; } - + public void setEndpoint(Endpoint2 endpoint) { this.endpoint = endpoint; } - + public InterfaceContract getInterfaceContract() { return interfaceContract; } - + public void setInterfaceContract(InterfaceContract interfaceContract) { this.interfaceContract = interfaceContract; } - + public String getURI() { return uri; } - + public void setURI(String uri) { this.uri = uri; - } + } + + public List<PolicySet> getPolicySets() { + return policySets; + } + + public List<Intent> getRequiredIntents() { + return requiredIntents; + } + + public ExtensionType getType() { + if (binding instanceof PolicySubject) { + return ((PolicySubject)binding).getType(); + } + return null; + } + + public void setType(ExtensionType type) { + throw new UnsupportedOperationException(); + } } |