From 54aca9cf5e6f8ac5a56b0f686fab1c69f3bc90bd Mon Sep 17 00:00:00 2001 From: slaws Date: Mon, 15 Jun 2009 12:56:33 +0000 Subject: 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 --- .../apache/tuscany/sca/assembly/EndpointReference.java | 16 ++++++++++++++++ .../ComponentReferenceEndpointReferenceBuilderImpl.java | 10 +++++++--- .../tuscany/sca/assembly/impl/EndpointReferenceImpl.java | 9 +++++++++ 3 files changed, 32 insertions(+), 3 deletions(-) (limited to 'java/sca') 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 policySets = new ArrayList(); protected List requiredIntents = new ArrayList(); 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() { } -- cgit v1.2.3