diff options
author | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2009-06-15 12:56:33 +0000 |
---|---|---|
committer | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2009-06-15 12:56:33 +0000 |
commit | 54aca9cf5e6f8ac5a56b0f686fab1c69f3bc90bd (patch) | |
tree | 21113ca304edb99dcbb99c0bfe67bc4d3a4fdb14 /java/sca | |
parent | 7ab7b9c9a1229b5c108c054d3a2a95debeec7c36 (diff) |
TUSCANY-3092 - add a flag recording whether an endpoint reference refers to a remote endpoint and set it accordingly. Not used for anything yet.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@784761 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca')
3 files changed, 32 insertions, 3 deletions
diff --git a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/EndpointReference.java b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/EndpointReference.java index 073f592c9b..204719e7e4 100644 --- a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/EndpointReference.java +++ b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/EndpointReference.java @@ -139,6 +139,22 @@ public interface EndpointReference extends Base, PolicySubject, Cloneable, Seria * @param callbackEndpoint the reference callback endpoint */ void setCallbackEndpoint(Endpoint callbackEndpoint); + + /** + * Returns true if this endpoint reference refers to an endpoint that + * is not running in this endpoint reference + * + * @return true if the endpoint is remote + */ + boolean getIsRemoteReference(); + + /** + * Set true if this endpoint reference refers to an endpoint that + * is not running in this endpoint reference + * + * @param isRemoteReference set to true if the endpoint is remote + */ + void setIsRemoteReference(boolean isRemoteReference); /** * Set the extension point registry against the endpoint after it is deserialized as diff --git a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentReferenceEndpointReferenceBuilderImpl.java b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentReferenceEndpointReferenceBuilderImpl.java index 58a6629608..5439ca538f 100644 --- a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentReferenceEndpointReferenceBuilderImpl.java +++ b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentReferenceEndpointReferenceBuilderImpl.java @@ -210,6 +210,7 @@ public class ComponentReferenceEndpointReferenceBuilderImpl extends BaseBuilderI // add an unresolved endpoint reference with an unresolved endpoint to go with it EndpointReference endpointRef = createEndpointRef( component, reference, true ); endpointRef.setTargetEndpoint(createEndpoint(component, targetName)); + endpointRef.setIsRemoteReference(true); reference.getEndpointReferences().add(endpointRef); warning(monitor, "ComponentReferenceTargetNotFound", composite, @@ -237,6 +238,7 @@ public class ComponentReferenceEndpointReferenceBuilderImpl extends BaseBuilderI EndpointReference endpointRef = createEndpointRef( component, reference, binding, null, false ); endpointRef.setTargetEndpoint(createEndpoint(false)); + endpointRef.setIsRemoteReference(true); reference.getEndpointReferences().add(endpointRef); continue; } // end if @@ -279,6 +281,7 @@ public class ComponentReferenceEndpointReferenceBuilderImpl extends BaseBuilderI // to signify that this reference is pointing at some unwired endpoint EndpointReference endpointRef = createEndpointRef( component, reference, binding, null, false ); endpointRef.setTargetEndpoint(createEndpoint( false )); + endpointRef.setIsRemoteReference(true); reference.getEndpointReferences().add(endpointRef); } // end if } @@ -443,9 +446,10 @@ public class ComponentReferenceEndpointReferenceBuilderImpl extends BaseBuilderI // are matched and bindings are configured later // TODO Endpoint endpoint = selectTargetEndpoint( reference, targetComponentService ); - System.out.println("Selected Endpoint: component=" + endpoint.getComponent().getName() + - " service=" + endpoint.getService().getName() + - " binding=" + endpoint.getBinding().toString()); + // SL - Turn off for now + //System.out.println("Selected Endpoint: component=" + endpoint.getComponent().getName() + + // " service=" + endpoint.getService().getName() + + // " binding=" + endpoint.getBinding().toString()); Endpoint endpoint2 = createEndpoint(targetComponent, targetComponentService, true); endpoint2.setBinding( endpoint.getBinding() ); endpoints.add( endpoint2 ); diff --git a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/EndpointReferenceImpl.java b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/EndpointReferenceImpl.java index eb611339d1..aad851eb3b 100644 --- a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/EndpointReferenceImpl.java +++ b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/EndpointReferenceImpl.java @@ -49,6 +49,7 @@ public class EndpointReferenceImpl implements EndpointReference { protected List<PolicySet> policySets = new ArrayList<PolicySet>(); protected List<Intent> requiredIntents = new ArrayList<Intent>(); protected InterfaceContract interfaceContract; + protected boolean isRemoteReference = false; // the target of the endpoint reference protected Endpoint targetEndpoint; @@ -199,6 +200,14 @@ public class EndpointReferenceImpl implements EndpointReference { public void setURI(String uri) { this.uri = uri; } + + public boolean getIsRemoteReference() { + return isRemoteReference; + } + + public void setIsRemoteReference(boolean isRemoteReference) { + this.isRemoteReference = isRemoteReference; + } protected void resolve() { } |