diff options
author | Benoit Foucher <benoit@zeroc.com> | 2014-04-15 09:41:21 +0200 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2014-04-15 09:41:21 +0200 |
commit | 54884a0b4c139118fc49498b6d6715d7d9ab718c (patch) | |
tree | 1f00091ad68543b3dc9828f27e32c0d9f7d072fe /java/src | |
parent | VC11 fixes for PHP 5.5 (diff) | |
download | ice-54884a0b4c139118fc49498b6d6715d7d9ab718c.tar.bz2 ice-54884a0b4c139118fc49498b6d6715d7d9ab718c.tar.xz ice-54884a0b4c139118fc49498b6d6715d7d9ab718c.zip |
Added support for IceGrid custom load balancing
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/IceGridGUI/Application/ReplicaGroupEditor.java | 19 | ||||
-rw-r--r-- | java/src/IceGridGUI/Application/ReplicaGroups.java | 1 | ||||
-rw-r--r-- | java/src/IceInternal/FixedReference.java | 2 | ||||
-rw-r--r-- | java/src/IceInternal/PropertyNames.java | 40 | ||||
-rw-r--r-- | java/src/IceInternal/Reference.java | 5 | ||||
-rw-r--r-- | java/src/IceInternal/ReferenceFactory.java | 23 | ||||
-rw-r--r-- | java/src/IceInternal/RoutableReference.java | 5 |
7 files changed, 81 insertions, 14 deletions
diff --git a/java/src/IceGridGUI/Application/ReplicaGroupEditor.java b/java/src/IceGridGUI/Application/ReplicaGroupEditor.java index 2240e7e1dae..7d0e38c4b2a 100644 --- a/java/src/IceGridGUI/Application/ReplicaGroupEditor.java +++ b/java/src/IceGridGUI/Application/ReplicaGroupEditor.java @@ -219,6 +219,10 @@ class ReplicaGroupEditor extends Editor _proxyOptions.getDocument().addDocumentListener(_updateListener); _proxyOptions.setToolTipText("The proxy options used for proxies created by IceGrid for the replica group"); + + _filter.getDocument().addDocumentListener(_updateListener); + _filter.setToolTipText("An optional filter for this replica group. Filters are installed by registry" + + "plugin to provide custom load balancing for replica groups."); } void writeDescriptor() @@ -229,6 +233,7 @@ class ReplicaGroupEditor extends Editor descriptor.description = _description.getText(); descriptor.objects = _objectList; descriptor.proxyOptions = _proxyOptions.getText().trim(); + descriptor.filter = _filter.getText(); Object loadBalancing = _loadBalancing.getSelectedItem(); if(loadBalancing == ORDERED) { @@ -279,6 +284,10 @@ class ReplicaGroupEditor extends Editor builder.append(_proxyOptions, 3); builder.nextLine(); + builder.append("Filter"); + builder.append(_filter, 3); + builder.nextLine(); + builder.append("Well-known Objects"); builder.nextLine(); builder.append(""); @@ -349,6 +358,9 @@ class ReplicaGroupEditor extends Editor _proxyOptions.setText(descriptor.proxyOptions); _proxyOptions.setEditable(isEditable); + _filter.setText(descriptor.filter); + _filter.setEditable(isEditable); + _objects.set(objectDescriptorSeqToMap(descriptor.objects), resolver, isEditable); _loadBalancing.setEnabled(true); @@ -459,11 +471,12 @@ class ReplicaGroupEditor extends Editor private JTextField _id = new JTextField(20); private JTextArea _description = new JTextArea(3, 20); private JTextField _proxyOptions = new JTextField(20); + private JTextField _filter = new JTextField(20); private JComboBox _loadBalancing = new JComboBox(new String[] {ADAPTIVE, - ORDERED, - RANDOM, - ROUND_ROBIN}); + ORDERED, + RANDOM, + ROUND_ROBIN}); private JTextField _nReplicas = new JTextField(20); diff --git a/java/src/IceGridGUI/Application/ReplicaGroups.java b/java/src/IceGridGUI/Application/ReplicaGroups.java index 1286dc30607..f403973c503 100644 --- a/java/src/IceGridGUI/Application/ReplicaGroups.java +++ b/java/src/IceGridGUI/Application/ReplicaGroups.java @@ -66,6 +66,7 @@ class ReplicaGroups extends ListTreeNode null, "", new java.util.LinkedList<ObjectDescriptor>(), + "", ""); newReplicaGroup(descriptor); diff --git a/java/src/IceInternal/FixedReference.java b/java/src/IceInternal/FixedReference.java index 479075cc1f6..ff3f7e65839 100644 --- a/java/src/IceInternal/FixedReference.java +++ b/java/src/IceInternal/FixedReference.java @@ -21,7 +21,7 @@ public class FixedReference extends Reference Ice.EncodingVersion encoding, Ice.ConnectionI connection) { - super(instance, communicator, identity, facet, mode, secure, Ice.Util.Protocol_1_0, encoding); + super(instance, communicator, identity, facet, mode, secure, Ice.Util.Protocol_1_0, encoding, null); _fixedConnection = connection; } diff --git a/java/src/IceInternal/PropertyNames.java b/java/src/IceInternal/PropertyNames.java index 58f8f05c6ec..ea30926a1ff 100644 --- a/java/src/IceInternal/PropertyNames.java +++ b/java/src/IceInternal/PropertyNames.java @@ -7,8 +7,8 @@ // // ********************************************************************** -// -// Generated by makeprops.py from file ./config/PropertyNames.xml, Fri Jul 26 23:12:55 2013 +///* jshint -W044*/ +// Generated by makeprops.py from file ../config/PropertyNames.xml, Mon Apr 7 14:21:14 2014 // IMPORTANT: Do not edit this file -- any edits made here will be lost! @@ -30,6 +30,7 @@ public final class PropertyNames new Property("Ice\\.Admin\\.Locator\\.Locator", false, null), new Property("Ice\\.Admin\\.Locator\\.Router", false, null), new Property("Ice\\.Admin\\.Locator\\.CollocationOptimized", false, null), + new Property("Ice\\.Admin\\.Locator\\.Context\\.[^\\s]+", false, null), new Property("Ice\\.Admin\\.Locator", false, null), new Property("Ice\\.Admin\\.PublishedEndpoints", false, null), new Property("Ice\\.Admin\\.ReplicaGroupId", false, null), @@ -40,6 +41,7 @@ public final class PropertyNames new Property("Ice\\.Admin\\.Router\\.Locator", false, null), new Property("Ice\\.Admin\\.Router\\.Router", false, null), new Property("Ice\\.Admin\\.Router\\.CollocationOptimized", false, null), + new Property("Ice\\.Admin\\.Router\\.Context\\.[^\\s]+", false, null), new Property("Ice\\.Admin\\.Router", false, null), new Property("Ice\\.Admin\\.ProxyOptions", false, null), new Property("Ice\\.Admin\\.ThreadPool\\.Size", false, null), @@ -71,6 +73,7 @@ public final class PropertyNames new Property("Ice\\.Default\\.Locator\\.Locator", false, null), new Property("Ice\\.Default\\.Locator\\.Router", false, null), new Property("Ice\\.Default\\.Locator\\.CollocationOptimized", false, null), + new Property("Ice\\.Default\\.Locator\\.Context\\.[^\\s]+", false, null), new Property("Ice\\.Default\\.Locator", false, null), new Property("Ice\\.Default\\.LocatorCacheTimeout", false, null), new Property("Ice\\.Default\\.Package", false, null), @@ -83,6 +86,7 @@ public final class PropertyNames new Property("Ice\\.Default\\.Router\\.Locator", false, null), new Property("Ice\\.Default\\.Router\\.Router", false, null), new Property("Ice\\.Default\\.Router\\.CollocationOptimized", false, null), + new Property("Ice\\.Default\\.Router\\.Context\\.[^\\s]+", false, null), new Property("Ice\\.Default\\.Router", false, null), new Property("Ice\\.Default\\.SlicedFormat", false, null), new Property("Ice\\.IPv4", false, null), @@ -186,6 +190,7 @@ public final class PropertyNames new Property("IceBox\\.ServiceManager\\.Locator\\.Locator", false, null), new Property("IceBox\\.ServiceManager\\.Locator\\.Router", false, null), new Property("IceBox\\.ServiceManager\\.Locator\\.CollocationOptimized", false, null), + new Property("IceBox\\.ServiceManager\\.Locator\\.Context\\.[^\\s]+", false, null), new Property("IceBox\\.ServiceManager\\.Locator", false, null), new Property("IceBox\\.ServiceManager\\.PublishedEndpoints", false, null), new Property("IceBox\\.ServiceManager\\.ReplicaGroupId", false, null), @@ -196,6 +201,7 @@ public final class PropertyNames new Property("IceBox\\.ServiceManager\\.Router\\.Locator", false, null), new Property("IceBox\\.ServiceManager\\.Router\\.Router", false, null), new Property("IceBox\\.ServiceManager\\.Router\\.CollocationOptimized", false, null), + new Property("IceBox\\.ServiceManager\\.Router\\.Context\\.[^\\s]+", false, null), new Property("IceBox\\.ServiceManager\\.Router", false, null), new Property("IceBox\\.ServiceManager\\.ProxyOptions", false, null), new Property("IceBox\\.ServiceManager\\.ThreadPool\\.Size", false, null), @@ -219,6 +225,7 @@ public final class PropertyNames new Property("IceBoxAdmin\\.ServiceManager\\.Proxy\\.Locator", false, null), new Property("IceBoxAdmin\\.ServiceManager\\.Proxy\\.Router", false, null), new Property("IceBoxAdmin\\.ServiceManager\\.Proxy\\.CollocationOptimized", false, null), + new Property("IceBoxAdmin\\.ServiceManager\\.Proxy\\.Context\\.[^\\s]+", false, null), new Property("IceBoxAdmin\\.ServiceManager\\.Proxy", false, null), null }; @@ -247,6 +254,7 @@ public final class PropertyNames new Property("IceGrid\\.AdminRouter\\.Locator\\.Locator", false, null), new Property("IceGrid\\.AdminRouter\\.Locator\\.Router", false, null), new Property("IceGrid\\.AdminRouter\\.Locator\\.CollocationOptimized", false, null), + new Property("IceGrid\\.AdminRouter\\.Locator\\.Context\\.[^\\s]+", false, null), new Property("IceGrid\\.AdminRouter\\.Locator", false, null), new Property("IceGrid\\.AdminRouter\\.PublishedEndpoints", false, null), new Property("IceGrid\\.AdminRouter\\.ReplicaGroupId", false, null), @@ -257,6 +265,7 @@ public final class PropertyNames new Property("IceGrid\\.AdminRouter\\.Router\\.Locator", false, null), new Property("IceGrid\\.AdminRouter\\.Router\\.Router", false, null), new Property("IceGrid\\.AdminRouter\\.Router\\.CollocationOptimized", false, null), + new Property("IceGrid\\.AdminRouter\\.Router\\.Context\\.[^\\s]+", false, null), new Property("IceGrid\\.AdminRouter\\.Router", false, null), new Property("IceGrid\\.AdminRouter\\.ProxyOptions", false, null), new Property("IceGrid\\.AdminRouter\\.ThreadPool\\.Size", false, null), @@ -277,6 +286,7 @@ public final class PropertyNames new Property("IceGrid\\.Node\\.Locator\\.Locator", false, null), new Property("IceGrid\\.Node\\.Locator\\.Router", false, null), new Property("IceGrid\\.Node\\.Locator\\.CollocationOptimized", false, null), + new Property("IceGrid\\.Node\\.Locator\\.Context\\.[^\\s]+", false, null), new Property("IceGrid\\.Node\\.Locator", false, null), new Property("IceGrid\\.Node\\.PublishedEndpoints", false, null), new Property("IceGrid\\.Node\\.ReplicaGroupId", false, null), @@ -287,6 +297,7 @@ public final class PropertyNames new Property("IceGrid\\.Node\\.Router\\.Locator", false, null), new Property("IceGrid\\.Node\\.Router\\.Router", false, null), new Property("IceGrid\\.Node\\.Router\\.CollocationOptimized", false, null), + new Property("IceGrid\\.Node\\.Router\\.Context\\.[^\\s]+", false, null), new Property("IceGrid\\.Node\\.Router", false, null), new Property("IceGrid\\.Node\\.ProxyOptions", false, null), new Property("IceGrid\\.Node\\.ThreadPool\\.Size", false, null), @@ -320,6 +331,7 @@ public final class PropertyNames new Property("IceGrid\\.Node\\.UserAccountMapper\\.Locator", false, null), new Property("IceGrid\\.Node\\.UserAccountMapper\\.Router", false, null), new Property("IceGrid\\.Node\\.UserAccountMapper\\.CollocationOptimized", false, null), + new Property("IceGrid\\.Node\\.UserAccountMapper\\.Context\\.[^\\s]+", false, null), new Property("IceGrid\\.Node\\.UserAccountMapper", false, null), new Property("IceGrid\\.Node\\.WaitTime", false, null), new Property("IceGrid\\.Registry\\.AdminCryptPasswords", false, null), @@ -330,6 +342,7 @@ public final class PropertyNames new Property("IceGrid\\.Registry\\.AdminPermissionsVerifier\\.Locator", false, null), new Property("IceGrid\\.Registry\\.AdminPermissionsVerifier\\.Router", false, null), new Property("IceGrid\\.Registry\\.AdminPermissionsVerifier\\.CollocationOptimized", false, null), + new Property("IceGrid\\.Registry\\.AdminPermissionsVerifier\\.Context\\.[^\\s]+", false, null), new Property("IceGrid\\.Registry\\.AdminPermissionsVerifier", false, null), new Property("IceGrid\\.Registry\\.AdminSessionFilters", false, null), new Property("IceGrid\\.Registry\\.AdminSessionManager\\.ACM", false, null), @@ -342,6 +355,7 @@ public final class PropertyNames new Property("IceGrid\\.Registry\\.AdminSessionManager\\.Locator\\.Locator", false, null), new Property("IceGrid\\.Registry\\.AdminSessionManager\\.Locator\\.Router", false, null), new Property("IceGrid\\.Registry\\.AdminSessionManager\\.Locator\\.CollocationOptimized", false, null), + new Property("IceGrid\\.Registry\\.AdminSessionManager\\.Locator\\.Context\\.[^\\s]+", false, null), new Property("IceGrid\\.Registry\\.AdminSessionManager\\.Locator", false, null), new Property("IceGrid\\.Registry\\.AdminSessionManager\\.PublishedEndpoints", false, null), new Property("IceGrid\\.Registry\\.AdminSessionManager\\.ReplicaGroupId", false, null), @@ -352,6 +366,7 @@ public final class PropertyNames new Property("IceGrid\\.Registry\\.AdminSessionManager\\.Router\\.Locator", false, null), new Property("IceGrid\\.Registry\\.AdminSessionManager\\.Router\\.Router", false, null), new Property("IceGrid\\.Registry\\.AdminSessionManager\\.Router\\.CollocationOptimized", false, null), + new Property("IceGrid\\.Registry\\.AdminSessionManager\\.Router\\.Context\\.[^\\s]+", false, null), new Property("IceGrid\\.Registry\\.AdminSessionManager\\.Router", false, null), new Property("IceGrid\\.Registry\\.AdminSessionManager\\.ProxyOptions", false, null), new Property("IceGrid\\.Registry\\.AdminSessionManager\\.ThreadPool\\.Size", false, null), @@ -368,6 +383,7 @@ public final class PropertyNames new Property("IceGrid\\.Registry\\.AdminSSLPermissionsVerifier\\.Locator", false, null), new Property("IceGrid\\.Registry\\.AdminSSLPermissionsVerifier\\.Router", false, null), new Property("IceGrid\\.Registry\\.AdminSSLPermissionsVerifier\\.CollocationOptimized", false, null), + new Property("IceGrid\\.Registry\\.AdminSSLPermissionsVerifier\\.Context\\.[^\\s]+", false, null), new Property("IceGrid\\.Registry\\.AdminSSLPermissionsVerifier", false, null), new Property("IceGrid\\.Registry\\.Client\\.ACM", false, null), new Property("IceGrid\\.Registry\\.Client\\.AdapterId", false, null), @@ -379,6 +395,7 @@ public final class PropertyNames new Property("IceGrid\\.Registry\\.Client\\.Locator\\.Locator", false, null), new Property("IceGrid\\.Registry\\.Client\\.Locator\\.Router", false, null), new Property("IceGrid\\.Registry\\.Client\\.Locator\\.CollocationOptimized", false, null), + new Property("IceGrid\\.Registry\\.Client\\.Locator\\.Context\\.[^\\s]+", false, null), new Property("IceGrid\\.Registry\\.Client\\.Locator", false, null), new Property("IceGrid\\.Registry\\.Client\\.PublishedEndpoints", false, null), new Property("IceGrid\\.Registry\\.Client\\.ReplicaGroupId", false, null), @@ -389,6 +406,7 @@ public final class PropertyNames new Property("IceGrid\\.Registry\\.Client\\.Router\\.Locator", false, null), new Property("IceGrid\\.Registry\\.Client\\.Router\\.Router", false, null), new Property("IceGrid\\.Registry\\.Client\\.Router\\.CollocationOptimized", false, null), + new Property("IceGrid\\.Registry\\.Client\\.Router\\.Context\\.[^\\s]+", false, null), new Property("IceGrid\\.Registry\\.Client\\.Router", false, null), new Property("IceGrid\\.Registry\\.Client\\.ProxyOptions", false, null), new Property("IceGrid\\.Registry\\.Client\\.ThreadPool\\.Size", false, null), @@ -412,6 +430,7 @@ public final class PropertyNames new Property("IceGrid\\.Registry\\.Internal\\.Locator\\.Locator", false, null), new Property("IceGrid\\.Registry\\.Internal\\.Locator\\.Router", false, null), new Property("IceGrid\\.Registry\\.Internal\\.Locator\\.CollocationOptimized", false, null), + new Property("IceGrid\\.Registry\\.Internal\\.Locator\\.Context\\.[^\\s]+", false, null), new Property("IceGrid\\.Registry\\.Internal\\.Locator", false, null), new Property("IceGrid\\.Registry\\.Internal\\.PublishedEndpoints", false, null), new Property("IceGrid\\.Registry\\.Internal\\.ReplicaGroupId", false, null), @@ -422,6 +441,7 @@ public final class PropertyNames new Property("IceGrid\\.Registry\\.Internal\\.Router\\.Locator", false, null), new Property("IceGrid\\.Registry\\.Internal\\.Router\\.Router", false, null), new Property("IceGrid\\.Registry\\.Internal\\.Router\\.CollocationOptimized", false, null), + new Property("IceGrid\\.Registry\\.Internal\\.Router\\.Context\\.[^\\s]+", false, null), new Property("IceGrid\\.Registry\\.Internal\\.Router", false, null), new Property("IceGrid\\.Registry\\.Internal\\.ProxyOptions", false, null), new Property("IceGrid\\.Registry\\.Internal\\.ThreadPool\\.Size", false, null), @@ -439,6 +459,7 @@ public final class PropertyNames new Property("IceGrid\\.Registry\\.PermissionsVerifier\\.Locator", false, null), new Property("IceGrid\\.Registry\\.PermissionsVerifier\\.Router", false, null), new Property("IceGrid\\.Registry\\.PermissionsVerifier\\.CollocationOptimized", false, null), + new Property("IceGrid\\.Registry\\.PermissionsVerifier\\.Context\\.[^\\s]+", false, null), new Property("IceGrid\\.Registry\\.PermissionsVerifier", false, null), new Property("IceGrid\\.Registry\\.ReplicaName", false, null), new Property("IceGrid\\.Registry\\.ReplicaSessionTimeout", false, null), @@ -454,6 +475,7 @@ public final class PropertyNames new Property("IceGrid\\.Registry\\.Server\\.Locator\\.Locator", false, null), new Property("IceGrid\\.Registry\\.Server\\.Locator\\.Router", false, null), new Property("IceGrid\\.Registry\\.Server\\.Locator\\.CollocationOptimized", false, null), + new Property("IceGrid\\.Registry\\.Server\\.Locator\\.Context\\.[^\\s]+", false, null), new Property("IceGrid\\.Registry\\.Server\\.Locator", false, null), new Property("IceGrid\\.Registry\\.Server\\.PublishedEndpoints", false, null), new Property("IceGrid\\.Registry\\.Server\\.ReplicaGroupId", false, null), @@ -464,6 +486,7 @@ public final class PropertyNames new Property("IceGrid\\.Registry\\.Server\\.Router\\.Locator", false, null), new Property("IceGrid\\.Registry\\.Server\\.Router\\.Router", false, null), new Property("IceGrid\\.Registry\\.Server\\.Router\\.CollocationOptimized", false, null), + new Property("IceGrid\\.Registry\\.Server\\.Router\\.Context\\.[^\\s]+", false, null), new Property("IceGrid\\.Registry\\.Server\\.Router", false, null), new Property("IceGrid\\.Registry\\.Server\\.ProxyOptions", false, null), new Property("IceGrid\\.Registry\\.Server\\.ThreadPool\\.Size", false, null), @@ -484,6 +507,7 @@ public final class PropertyNames new Property("IceGrid\\.Registry\\.SessionManager\\.Locator\\.Locator", false, null), new Property("IceGrid\\.Registry\\.SessionManager\\.Locator\\.Router", false, null), new Property("IceGrid\\.Registry\\.SessionManager\\.Locator\\.CollocationOptimized", false, null), + new Property("IceGrid\\.Registry\\.SessionManager\\.Locator\\.Context\\.[^\\s]+", false, null), new Property("IceGrid\\.Registry\\.SessionManager\\.Locator", false, null), new Property("IceGrid\\.Registry\\.SessionManager\\.PublishedEndpoints", false, null), new Property("IceGrid\\.Registry\\.SessionManager\\.ReplicaGroupId", false, null), @@ -494,6 +518,7 @@ public final class PropertyNames new Property("IceGrid\\.Registry\\.SessionManager\\.Router\\.Locator", false, null), new Property("IceGrid\\.Registry\\.SessionManager\\.Router\\.Router", false, null), new Property("IceGrid\\.Registry\\.SessionManager\\.Router\\.CollocationOptimized", false, null), + new Property("IceGrid\\.Registry\\.SessionManager\\.Router\\.Context\\.[^\\s]+", false, null), new Property("IceGrid\\.Registry\\.SessionManager\\.Router", false, null), new Property("IceGrid\\.Registry\\.SessionManager\\.ProxyOptions", false, null), new Property("IceGrid\\.Registry\\.SessionManager\\.ThreadPool\\.Size", false, null), @@ -511,6 +536,7 @@ public final class PropertyNames new Property("IceGrid\\.Registry\\.SSLPermissionsVerifier\\.Locator", false, null), new Property("IceGrid\\.Registry\\.SSLPermissionsVerifier\\.Router", false, null), new Property("IceGrid\\.Registry\\.SSLPermissionsVerifier\\.CollocationOptimized", false, null), + new Property("IceGrid\\.Registry\\.SSLPermissionsVerifier\\.Context\\.[^\\s]+", false, null), new Property("IceGrid\\.Registry\\.SSLPermissionsVerifier", false, null), new Property("IceGrid\\.Registry\\.Trace\\.Application", false, null), new Property("IceGrid\\.Registry\\.Trace\\.Adapter", false, null), @@ -547,6 +573,7 @@ public final class PropertyNames new Property("IcePatch2\\.Locator\\.Locator", false, null), new Property("IcePatch2\\.Locator\\.Router", false, null), new Property("IcePatch2\\.Locator\\.CollocationOptimized", false, null), + new Property("IcePatch2\\.Locator\\.Context\\.[^\\s]+", false, null), new Property("IcePatch2\\.Locator", false, null), new Property("IcePatch2\\.PublishedEndpoints", false, null), new Property("IcePatch2\\.ReplicaGroupId", false, null), @@ -557,6 +584,7 @@ public final class PropertyNames new Property("IcePatch2\\.Router\\.Locator", false, null), new Property("IcePatch2\\.Router\\.Router", false, null), new Property("IcePatch2\\.Router\\.CollocationOptimized", false, null), + new Property("IcePatch2\\.Router\\.Context\\.[^\\s]+", false, null), new Property("IcePatch2\\.Router", false, null), new Property("IcePatch2\\.ProxyOptions", false, null), new Property("IcePatch2\\.ThreadPool\\.Size", false, null), @@ -644,6 +672,7 @@ public final class PropertyNames new Property("Glacier2\\.Client\\.Locator\\.Locator", false, null), new Property("Glacier2\\.Client\\.Locator\\.Router", false, null), new Property("Glacier2\\.Client\\.Locator\\.CollocationOptimized", false, null), + new Property("Glacier2\\.Client\\.Locator\\.Context\\.[^\\s]+", false, null), new Property("Glacier2\\.Client\\.Locator", false, null), new Property("Glacier2\\.Client\\.PublishedEndpoints", false, null), new Property("Glacier2\\.Client\\.ReplicaGroupId", false, null), @@ -654,6 +683,7 @@ public final class PropertyNames new Property("Glacier2\\.Client\\.Router\\.Locator", false, null), new Property("Glacier2\\.Client\\.Router\\.Router", false, null), new Property("Glacier2\\.Client\\.Router\\.CollocationOptimized", false, null), + new Property("Glacier2\\.Client\\.Router\\.Context\\.[^\\s]+", false, null), new Property("Glacier2\\.Client\\.Router", false, null), new Property("Glacier2\\.Client\\.ProxyOptions", false, null), new Property("Glacier2\\.Client\\.ThreadPool\\.Size", false, null), @@ -686,6 +716,7 @@ public final class PropertyNames new Property("Glacier2\\.PermissionsVerifier\\.Locator", false, null), new Property("Glacier2\\.PermissionsVerifier\\.Router", false, null), new Property("Glacier2\\.PermissionsVerifier\\.CollocationOptimized", false, null), + new Property("Glacier2\\.PermissionsVerifier\\.Context\\.[^\\s]+", false, null), new Property("Glacier2\\.PermissionsVerifier", false, null), new Property("Glacier2\\.ReturnClientProxy", false, null), new Property("Glacier2\\.SSLPermissionsVerifier\\.EndpointSelection", false, null), @@ -695,6 +726,7 @@ public final class PropertyNames new Property("Glacier2\\.SSLPermissionsVerifier\\.Locator", false, null), new Property("Glacier2\\.SSLPermissionsVerifier\\.Router", false, null), new Property("Glacier2\\.SSLPermissionsVerifier\\.CollocationOptimized", false, null), + new Property("Glacier2\\.SSLPermissionsVerifier\\.Context\\.[^\\s]+", false, null), new Property("Glacier2\\.SSLPermissionsVerifier", false, null), new Property("Glacier2\\.RoutingTable\\.MaxSize", false, null), new Property("Glacier2\\.Server\\.ACM", false, null), @@ -707,6 +739,7 @@ public final class PropertyNames new Property("Glacier2\\.Server\\.Locator\\.Locator", false, null), new Property("Glacier2\\.Server\\.Locator\\.Router", false, null), new Property("Glacier2\\.Server\\.Locator\\.CollocationOptimized", false, null), + new Property("Glacier2\\.Server\\.Locator\\.Context\\.[^\\s]+", false, null), new Property("Glacier2\\.Server\\.Locator", false, null), new Property("Glacier2\\.Server\\.PublishedEndpoints", false, null), new Property("Glacier2\\.Server\\.ReplicaGroupId", false, null), @@ -717,6 +750,7 @@ public final class PropertyNames new Property("Glacier2\\.Server\\.Router\\.Locator", false, null), new Property("Glacier2\\.Server\\.Router\\.Router", false, null), new Property("Glacier2\\.Server\\.Router\\.CollocationOptimized", false, null), + new Property("Glacier2\\.Server\\.Router\\.Context\\.[^\\s]+", false, null), new Property("Glacier2\\.Server\\.Router", false, null), new Property("Glacier2\\.Server\\.ProxyOptions", false, null), new Property("Glacier2\\.Server\\.ThreadPool\\.Size", false, null), @@ -739,6 +773,7 @@ public final class PropertyNames new Property("Glacier2\\.SessionManager\\.Locator", false, null), new Property("Glacier2\\.SessionManager\\.Router", false, null), new Property("Glacier2\\.SessionManager\\.CollocationOptimized", false, null), + new Property("Glacier2\\.SessionManager\\.Context\\.[^\\s]+", false, null), new Property("Glacier2\\.SessionManager", false, null), new Property("Glacier2\\.SSLSessionManager\\.EndpointSelection", false, null), new Property("Glacier2\\.SSLSessionManager\\.ConnectionCached", false, null), @@ -747,6 +782,7 @@ public final class PropertyNames new Property("Glacier2\\.SSLSessionManager\\.Locator", false, null), new Property("Glacier2\\.SSLSessionManager\\.Router", false, null), new Property("Glacier2\\.SSLSessionManager\\.CollocationOptimized", false, null), + new Property("Glacier2\\.SSLSessionManager\\.Context\\.[^\\s]+", false, null), new Property("Glacier2\\.SSLSessionManager", false, null), new Property("Glacier2\\.SessionTimeout", false, null), new Property("Glacier2\\.Trace\\.RoutingTable", false, null), diff --git a/java/src/IceInternal/Reference.java b/java/src/IceInternal/Reference.java index 15e342ec845..b9ba4a7b5d7 100644 --- a/java/src/IceInternal/Reference.java +++ b/java/src/IceInternal/Reference.java @@ -491,7 +491,8 @@ public abstract class Reference implements Cloneable int mode, boolean secure, Ice.ProtocolVersion protocol, - Ice.EncodingVersion encoding) + Ice.EncodingVersion encoding, + java.util.Map<String, String> context) { // // Validate string arguments. @@ -505,7 +506,7 @@ public abstract class Reference implements Cloneable _mode = mode; _secure = secure; _identity = identity; - _context = _emptyContext; + _context = context != null ? new java.util.HashMap<String, String>(context) : _emptyContext; _facet = facet; _protocol = protocol; _encoding = encoding; 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; diff --git a/java/src/IceInternal/RoutableReference.java b/java/src/IceInternal/RoutableReference.java index 7e45ade9c9d..694975959c5 100644 --- a/java/src/IceInternal/RoutableReference.java +++ b/java/src/IceInternal/RoutableReference.java @@ -655,9 +655,10 @@ public class RoutableReference extends Reference boolean cacheConnection, boolean prefereSecure, Ice.EndpointSelectionType endpointSelection, - int locatorCacheTimeout) + int locatorCacheTimeout, + java.util.Map<String, String> context) { - super(instance, communicator, identity, facet, mode, secure, protocol, encoding); + super(instance, communicator, identity, facet, mode, secure, protocol, encoding, context); _endpoints = endpoints; _adapterId = adapterId; _locatorInfo = locatorInfo; |