diff options
author | Benoit Foucher <benoit@zeroc.com> | 2008-01-15 10:15:19 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2008-01-15 10:15:19 +0100 |
commit | f00672fd53741dc528b81ed7f53dcca8276c2014 (patch) | |
tree | 3625b90e69b8b3ffefc35567c1eeafb2ef07c276 /java/src | |
parent | More documentation changes wrt mcpp usage. (diff) | |
download | ice-f00672fd53741dc528b81ed7f53dcca8276c2014.tar.bz2 ice-f00672fd53741dc528b81ed7f53dcca8276c2014.tar.xz ice-f00672fd53741dc528b81ed7f53dcca8276c2014.zip |
Fixed bug 1359
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/IceInternal/FixedReference.java | 23 | ||||
-rw-r--r-- | java/src/IceInternal/Reference.java | 27 | ||||
-rw-r--r-- | java/src/IceInternal/RoutableReference.java | 24 |
3 files changed, 39 insertions, 35 deletions
diff --git a/java/src/IceInternal/FixedReference.java b/java/src/IceInternal/FixedReference.java index 64f0818a88b..bc43460b555 100644 --- a/java/src/IceInternal/FixedReference.java +++ b/java/src/IceInternal/FixedReference.java @@ -145,15 +145,6 @@ public class FixedReference extends Reference } public Reference - changeCompress(boolean newCompress) - { - // TODO: FixedReferences should probably have a _compress flag, - // that gets its default from the fixed connection this reference - // refers to. This should be changable with changeCompress(). - throw new Ice.FixedProxyException(); - } - - public Reference changeTimeout(int newTimeout) { throw new Ice.FixedProxyException(); @@ -193,8 +184,20 @@ public class FixedReference extends Reference Ice.ConnectionI connection = filteredConns[0]; assert(connection != null); connection.throwException(); // Throw in case our connection is already destroyed. - compress.value = connection.endpoint().compress(); + DefaultsAndOverrides defaultsAndOverrides = getInstance().defaultsAndOverrides(); + if(defaultsAndOverrides.overrideCompress) + { + compress.value = defaultsAndOverrides.overrideCompressValue; + } + else if(_overrideCompress) + { + compress.value = _compress; + } + else + { + compress.value = connection.endpoint().compress(); + } return connection; } diff --git a/java/src/IceInternal/Reference.java b/java/src/IceInternal/Reference.java index eed4cd7693a..55f947e9880 100644 --- a/java/src/IceInternal/Reference.java +++ b/java/src/IceInternal/Reference.java @@ -150,11 +150,23 @@ public abstract class Reference implements Cloneable return r; } + public Reference + changeCompress(boolean newCompress) + { + if(_overrideCompress && _compress == newCompress) + { + return this; + } + Reference r = _instance.referenceFactory().copy(this); + r._compress = newCompress; + r._overrideCompress = true; + return r; + } + public abstract Reference changeSecure(boolean newSecure); public abstract Reference changePreferSecure(boolean newPreferSecure); public abstract Reference changeRouter(Ice.RouterPrx newRouter); public abstract Reference changeLocator(Ice.LocatorPrx newLocator); - public abstract Reference changeCompress(boolean newCompress); public abstract Reference changeTimeout(int newTimeout); public abstract Reference changeConnectionId(String connectionId); public abstract Reference changeCollocationOptimization(boolean newCollocationOptimization); @@ -362,6 +374,15 @@ public abstract class Reference implements Cloneable return false; } + if(_overrideCompress != r._overrideCompress) + { + return false; + } + if(_overrideCompress && _compress != r._compress) + { + return false; + } + return true; } @@ -392,6 +413,8 @@ public abstract class Reference implements Cloneable protected int _hashValue; protected boolean _hashInitialized; + protected boolean _overrideCompress; + protected boolean _compress; // Only used if _overrideCompress == true protected Reference(Instance inst, @@ -415,5 +438,7 @@ public abstract class Reference implements Cloneable _context = ctx == null ? _emptyContext : ctx; _facet = fac; _hashInitialized = false; + _overrideCompress = false; + _compress = false; } } diff --git a/java/src/IceInternal/RoutableReference.java b/java/src/IceInternal/RoutableReference.java index 213453b71cd..82dde6c8fe7 100644 --- a/java/src/IceInternal/RoutableReference.java +++ b/java/src/IceInternal/RoutableReference.java @@ -103,19 +103,6 @@ public abstract class RoutableReference extends Reference } public Reference - changeCompress(boolean newCompress) - { - if(_overrideCompress && _compress == newCompress) - { - return this; - } - RoutableReference r = (RoutableReference)getInstance().referenceFactory().copy(this); - r._compress = newCompress; - r._overrideCompress = true; - return r; - } - - public Reference changeTimeout(int newTimeout) { if(_overrideTimeout && _timeout == newTimeout) @@ -218,14 +205,6 @@ public abstract class RoutableReference extends Reference { return false; } - if(_overrideCompress != rhs._overrideCompress) - { - return false; - } - if(_overrideCompress && _compress != rhs._compress) - { - return false; - } if(_overrideTimeout != rhs._overrideTimeout) { return false; @@ -265,7 +244,6 @@ public abstract class RoutableReference extends Reference _cacheConnection = cacheConnection; _endpointSelection = endpointSelection; _overrideCompress = false; - _compress = false; _overrideTimeout = false; _timeout = -1; _threadPerConnection = threadPerConnection; @@ -628,8 +606,6 @@ public abstract class RoutableReference extends Reference private boolean _cacheConnection; private Ice.EndpointSelectionType _endpointSelection; private String _connectionId = ""; - private boolean _overrideCompress; - private boolean _compress; // Only used if _overrideCompress == true private boolean _overrideTimeout; private int _timeout; // Only used if _overrideTimeout == true private boolean _threadPerConnection; |