summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules/endpoint-hazelcast
diff options
context:
space:
mode:
authorantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2010-01-20 16:42:59 +0000
committerantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2010-01-20 16:42:59 +0000
commit630599c9de5bce09c7fb1f1b657ae36164c5cc40 (patch)
treecac9a8b81dd1a10644128a0725183bc79b7d59fa /sca-java-2.x/trunk/modules/endpoint-hazelcast
parent1006c4802c6dadbcc4ffc874044b8a8e7bf0ec2e (diff)
Start of making the Tuscany sca client impl work for both local or remote nodes and to be generic for any binding. Work in progress, only local invocations work presently
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@901270 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/endpoint-hazelcast')
-rw-r--r--sca-java-2.x/trunk/modules/endpoint-hazelcast/src/main/java/org/apache/tuscany/sca/endpoint/hazelcast/HazelcastEndpointRegistry.java35
1 files changed, 17 insertions, 18 deletions
diff --git a/sca-java-2.x/trunk/modules/endpoint-hazelcast/src/main/java/org/apache/tuscany/sca/endpoint/hazelcast/HazelcastEndpointRegistry.java b/sca-java-2.x/trunk/modules/endpoint-hazelcast/src/main/java/org/apache/tuscany/sca/endpoint/hazelcast/HazelcastEndpointRegistry.java
index f9ec30011e..3bc9fa9f66 100644
--- a/sca-java-2.x/trunk/modules/endpoint-hazelcast/src/main/java/org/apache/tuscany/sca/endpoint/hazelcast/HazelcastEndpointRegistry.java
+++ b/sca-java-2.x/trunk/modules/endpoint-hazelcast/src/main/java/org/apache/tuscany/sca/endpoint/hazelcast/HazelcastEndpointRegistry.java
@@ -197,32 +197,31 @@ public class HazelcastEndpointRegistry implements EndpointRegistry, LifeCycleLis
}
public List<Endpoint> findEndpoint(EndpointReference endpointReference) {
- List<Endpoint> foundEndpoints = new ArrayList<Endpoint>();
-
logger.fine("Find endpoint for reference - " + endpointReference);
-
if (endpointReference.getReference() != null) {
Endpoint targetEndpoint = endpointReference.getTargetEndpoint();
-
- for (Object v : map.values()) {
- Endpoint endpoint = (Endpoint)v;
- logger.fine("Matching against - " + endpoint);
- if (matches(targetEndpoint.getURI(), endpoint.getURI())) {
- if (!isLocal(endpoint)) {
- endpoint.setRemote(true);
- }
- // if (!entry.isPrimary()) {
- ((RuntimeEndpoint)endpoint).bind(registry, this);
- // }
- foundEndpoints.add(endpoint);
- logger.fine("Found endpoint with matching service - " + endpoint);
+ return findEndpoint(targetEndpoint.getURI());
+ }
+ return new ArrayList<Endpoint>();
+ }
+
+ public List<Endpoint> findEndpoint(String uri) {
+ List<Endpoint> foundEndpoints = new ArrayList<Endpoint>();
+ for (Object v : map.values()) {
+ Endpoint endpoint = (Endpoint)v;
+ logger.fine("Matching against - " + endpoint);
+ if (matches(uri, endpoint.getURI())) {
+ if (!isLocal(endpoint)) {
+ endpoint.setRemote(true);
}
- // else the service name doesn't match
+ ((RuntimeEndpoint)endpoint).bind(registry, this);
+ foundEndpoints.add(endpoint);
+ logger.fine("Found endpoint with matching service - " + endpoint);
}
}
-
return foundEndpoints;
}
+
private boolean isLocal(Endpoint endpoint) {
return localEndpoints.contains(endpoint.getURI());