diff options
author | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2009-08-28 12:58:09 +0000 |
---|---|---|
committer | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2009-08-28 12:58:09 +0000 |
commit | 4a125b077c05d1001351ee6437b93ad42707abfe (patch) | |
tree | b9d70abe407db3d6947fca7c8054d27542954b86 | |
parent | 841a47ff38d01ae7a53301ade66584543ca207c3 (diff) |
Update the tribes based endpoint registry to support being configured from the runtime configuration
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@808869 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r-- | java/sca/modules/endpoint-tribes/src/main/java/org/apache/tuscany/sca/endpoint/tribes/ReplicatedEndpointRegistry.java | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/java/sca/modules/endpoint-tribes/src/main/java/org/apache/tuscany/sca/endpoint/tribes/ReplicatedEndpointRegistry.java b/java/sca/modules/endpoint-tribes/src/main/java/org/apache/tuscany/sca/endpoint/tribes/ReplicatedEndpointRegistry.java index 819b0b60db..3af55b34eb 100644 --- a/java/sca/modules/endpoint-tribes/src/main/java/org/apache/tuscany/sca/endpoint/tribes/ReplicatedEndpointRegistry.java +++ b/java/sca/modules/endpoint-tribes/src/main/java/org/apache/tuscany/sca/endpoint/tribes/ReplicatedEndpointRegistry.java @@ -38,8 +38,10 @@ import org.apache.tuscany.sca.assembly.Endpoint; import org.apache.tuscany.sca.assembly.EndpointReference; import org.apache.tuscany.sca.core.ExtensionPointRegistry; import org.apache.tuscany.sca.core.LifeCycleListener; +import org.apache.tuscany.sca.core.UtilityExtensionPoint; import org.apache.tuscany.sca.endpoint.tribes.AbstractReplicatedMap.MapEntry; import org.apache.tuscany.sca.endpoint.tribes.MapStore.MapListener; +import org.apache.tuscany.sca.management.ConfigAttributes; import org.apache.tuscany.sca.runtime.EndpointListener; import org.apache.tuscany.sca.runtime.EndpointRegistry; @@ -87,6 +89,17 @@ public class ReplicatedEndpointRegistry implements EndpointRegistry, LifeCycleLi public ReplicatedEndpointRegistry(ExtensionPointRegistry registry, Map<String, String> attributes) { this.registry = registry; + + UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class); + ConfigAttributes domainConfig = utilities.getUtility(ConfigAttributes.class); + if (domainConfig != null) { + setConfig(domainConfig.getAttributes()); + } else { + setConfig(attributes); + } + } + + private void setConfig(Map<String, String> attributes) { String portStr = attributes.get("port"); if (portStr != null) { port = Integer.parseInt(portStr); @@ -100,7 +113,6 @@ public class ReplicatedEndpointRegistry implements EndpointRegistry, LifeCycleLi if (timeoutStr != null) { timeout = Integer.parseInt(timeoutStr); } - // start(); } public ReplicatedEndpointRegistry(String domainURI) { |