diff options
author | Benoit Foucher <benoit@zeroc.com> | 2012-04-20 17:29:10 +0200 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2012-04-20 17:29:10 +0200 |
commit | 410311ac0dad54bbc0906085134b41e12ed44abb (patch) | |
tree | 678d75e04b90c289628c1ae79100317432bfe1d8 /java/src/IceInternal/RoutableReference.java | |
parent | Enabled again objects test (diff) | |
download | ice-410311ac0dad54bbc0906085134b41e12ed44abb.tar.bz2 ice-410311ac0dad54bbc0906085134b41e12ed44abb.tar.xz ice-410311ac0dad54bbc0906085134b41e12ed44abb.zip |
Java port
Diffstat (limited to 'java/src/IceInternal/RoutableReference.java')
-rw-r--r-- | java/src/IceInternal/RoutableReference.java | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/java/src/IceInternal/RoutableReference.java b/java/src/IceInternal/RoutableReference.java index c90a57f082a..efd9658dc6b 100644 --- a/java/src/IceInternal/RoutableReference.java +++ b/java/src/IceInternal/RoutableReference.java @@ -334,6 +334,7 @@ public class RoutableReference extends Reference properties.put(prefix + ".PreferSecure", _preferSecure ? "1" : "0"); properties.put(prefix + ".EndpointSelection", _endpointSelection == Ice.EndpointSelectionType.Random ? "Random" : "Ordered"); + properties.put(prefix + ".EncodingVersion", Ice.Util.encodingVersionToString(getEncoding())); StringBuffer s = new StringBuffer(); s.append(_locatorCacheTimeout); @@ -631,6 +632,7 @@ public class RoutableReference extends Reference String facet, int mode, boolean secure, + Ice.EncodingVersion encoding, EndpointI[] endpoints, String adapterId, LocatorInfo locatorInfo, @@ -641,7 +643,7 @@ public class RoutableReference extends Reference Ice.EndpointSelectionType endpointSelection, int locatorCacheTimeout) { - super(instance, communicator, identity, facet, mode, secure); + super(instance, communicator, identity, facet, mode, secure, encoding); _endpoints = endpoints; _adapterId = adapterId; _locatorInfo = locatorInfo; @@ -691,13 +693,16 @@ public class RoutableReference extends Reference java.util.List<EndpointI> endpoints = new java.util.ArrayList<EndpointI>(); // - // Filter out opaque endpoints. + // Filter out incompatible endpoints (whose encoding/protocol + // versions aren't supported by this runtime, or are opaque). // - for(EndpointI endpoint : allEndpoints) + final Ice.EncodingVersion encoding = getEncoding(); + for(EndpointI p : allEndpoints) { - if(!(endpoint instanceof IceInternal.OpaqueEndpointI)) + if(Protocol.isSupported(encoding, p.encoding()) && + Protocol.isSupported(Protocol.currentProtocol, p.protocol())) { - endpoints.add(endpoint); + endpoints.add(p); } } |