summaryrefslogtreecommitdiff
path: root/java/src/IceInternal/ReferenceFactory.java
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2014-04-15 09:41:21 +0200
committerBenoit Foucher <benoit@zeroc.com>2014-04-15 09:41:21 +0200
commit54884a0b4c139118fc49498b6d6715d7d9ab718c (patch)
tree1f00091ad68543b3dc9828f27e32c0d9f7d072fe /java/src/IceInternal/ReferenceFactory.java
parentVC11 fixes for PHP 5.5 (diff)
downloadice-54884a0b4c139118fc49498b6d6715d7d9ab718c.tar.bz2
ice-54884a0b4c139118fc49498b6d6715d7d9ab718c.tar.xz
ice-54884a0b4c139118fc49498b6d6715d7d9ab718c.zip
Added support for IceGrid custom load balancing
Diffstat (limited to 'java/src/IceInternal/ReferenceFactory.java')
-rw-r--r--java/src/IceInternal/ReferenceFactory.java23
1 files changed, 19 insertions, 4 deletions
diff --git a/java/src/IceInternal/ReferenceFactory.java b/java/src/IceInternal/ReferenceFactory.java
index f678e4108c9..4c15505c11d 100644
--- a/java/src/IceInternal/ReferenceFactory.java
+++ b/java/src/IceInternal/ReferenceFactory.java
@@ -675,7 +675,8 @@ public final class ReferenceFactory
"LocatorCacheTimeout",
"Locator",
"Router",
- "CollocationOptimized"
+ "CollocationOptimized",
+ "Context\\..*"
};
private void
@@ -702,7 +703,8 @@ public final class ReferenceFactory
boolean valid = false;
for(String suffix : _suffixes)
{
- if(prop.equals(prefix + "." + suffix))
+ String pattern = java.util.regex.Pattern.quote(prefix + ".") + suffix;
+ if(java.util.regex.Pattern.compile(pattern).matcher(prop).matches())
{
valid = true;
break;
@@ -757,7 +759,8 @@ public final class ReferenceFactory
boolean preferSecure = defaultsAndOverrides.defaultPreferSecure;
Ice.EndpointSelectionType endpointSelection = defaultsAndOverrides.defaultEndpointSelection;
int locatorCacheTimeout = defaultsAndOverrides.defaultLocatorCacheTimeout;
-
+ java.util.Map<String, String> context = null;
+
//
// Override the defaults with the proxy properties if a property prefix is defined.
//
@@ -835,6 +838,17 @@ public final class ReferenceFactory
property = propertyPrefix + ".LocatorCacheTimeout";
locatorCacheTimeout = properties.getPropertyAsIntWithDefault(property, locatorCacheTimeout);
+
+ property = propertyPrefix + ".Context.";
+ java.util.Map<String, String> contexts = properties.getPropertiesForPrefix(property);
+ if(!contexts.isEmpty())
+ {
+ context = new java.util.HashMap<String, String>();
+ for(java.util.Map.Entry<String, String> e : contexts.entrySet())
+ {
+ context.put(e.getKey().substring(property.length()), e.getValue());
+ }
+ }
}
//
@@ -856,7 +870,8 @@ public final class ReferenceFactory
cacheConnection,
preferSecure,
endpointSelection,
- locatorCacheTimeout);
+ locatorCacheTimeout,
+ context);
}
final private Instance _instance;