summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules/core-spi/src
diff options
context:
space:
mode:
Diffstat (limited to 'sca-java-2.x/trunk/modules/core-spi/src')
-rw-r--r--sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/BaseEndpointRegistry.java17
-rw-r--r--sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointRegistry.java8
2 files changed, 25 insertions, 0 deletions
diff --git a/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/BaseEndpointRegistry.java b/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/BaseEndpointRegistry.java
index 65c1f8815b..1e7e1751a6 100644
--- a/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/BaseEndpointRegistry.java
+++ b/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/BaseEndpointRegistry.java
@@ -111,6 +111,23 @@ public abstract class BaseEndpointRegistry implements EndpointRegistry, LifeCycl
public List<EndpointReference> findEndpointReference(Endpoint endpoint) {
return endpointreferences;
}
+
+ /**
+ * Returns a list of EndpointReferences that have a URI that matches a given URI
+ * @param uri - the URI to match
+ * @return a List of EndpointReferences that match the supplied URI - if there are none
+ * an *empty* list is returned (not null)
+ */
+ public List<EndpointReference> findEndpointReferences( String uri ) {
+ List<EndpointReference> theRefs = new ArrayList<EndpointReference>();
+ if( uri == null ) return theRefs;
+
+ for( EndpointReference ref : endpointreferences ) {
+ if( uri.equals(ref.getURI()) ) theRefs.add(ref);
+ } // end for
+
+ return theRefs;
+ } // end method findEndpointReference
public abstract Endpoint getEndpoint(String uri);
diff --git a/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointRegistry.java b/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointRegistry.java
index 2c01eb115a..ed2d6894c0 100644
--- a/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointRegistry.java
+++ b/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointRegistry.java
@@ -63,6 +63,14 @@ public interface EndpointRegistry {
void removeEndpointReference(EndpointReference endpointReference);
// List<EndpointReference> findEndpointReference(Endpoint endpoint);
List<EndpointReference> getEndpointReferences();
+
+ /**
+ * Returns a list of EndpointReferences that have a URI that matches a given URI
+ * @param uri - the URI to match
+ * @return a List of EndpointReferences that match the supplied URI - if there are none
+ * an *empty* list is returned (not null)
+ */
+ public List<EndpointReference> findEndpointReferences( String uri );
void addListener(EndpointListener listener);
void removeListener(EndpointListener listener);