diff options
author | Benoit Foucher <benoit@zeroc.com> | 2006-06-07 14:57:29 +0000 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2006-06-07 14:57:29 +0000 |
commit | 9a4d145795d6efb52f030d45bae67d5860d0a9fe (patch) | |
tree | a35afe688cbf6536eb82ed02e5e873b4c275ddfb /java/src/IceInternal/DirectReference.java | |
parent | Fixed Glacier2 filtering in IceGrid and added tests. (diff) | |
download | ice-9a4d145795d6efb52f030d45bae67d5860d0a9fe.tar.bz2 ice-9a4d145795d6efb52f030d45bae67d5860d0a9fe.tar.xz ice-9a4d145795d6efb52f030d45bae67d5860d0a9fe.zip |
Fixed bug where timeout, compress and connection id attributes were not
taken into account for routed endpoints.
Diffstat (limited to 'java/src/IceInternal/DirectReference.java')
-rw-r--r-- | java/src/IceInternal/DirectReference.java | 56 |
1 files changed, 34 insertions, 22 deletions
diff --git a/java/src/IceInternal/DirectReference.java b/java/src/IceInternal/DirectReference.java index c8a2961adaf..fdc8aa1f315 100644 --- a/java/src/IceInternal/DirectReference.java +++ b/java/src/IceInternal/DirectReference.java @@ -54,39 +54,48 @@ public class DirectReference extends RoutableReference public Reference changeCompress(boolean newCompress) { - DirectReference r = (DirectReference)getInstance().referenceFactory().copy(this); - EndpointI[] newEndpoints = new EndpointI[_endpoints.length]; - for(int i = 0; i < _endpoints.length; i++) - { - newEndpoints[i] = _endpoints[i].compress(newCompress); - } - r._endpoints = newEndpoints; + DirectReference r = (DirectReference)super.changeCompress(newCompress); + if(r != this) // Also override the compress flag on the endpoints if it was updated. + { + EndpointI[] newEndpoints = new EndpointI[_endpoints.length]; + for(int i = 0; i < _endpoints.length; i++) + { + newEndpoints[i] = _endpoints[i].compress(newCompress); + } + r._endpoints = newEndpoints; + } return r; } public Reference changeTimeout(int newTimeout) { - DirectReference r = (DirectReference)getInstance().referenceFactory().copy(this); - EndpointI[] newEndpoints = new EndpointI[_endpoints.length]; - for(int i = 0; i < _endpoints.length; i++) - { - newEndpoints[i] = _endpoints[i].timeout(newTimeout); - } - r._endpoints = newEndpoints; + DirectReference r = (DirectReference)super.changeTimeout(newTimeout); + if(r != this) // Also override the timeout on the endpoints if it was updated. + { + EndpointI[] newEndpoints = new EndpointI[_endpoints.length]; + for(int i = 0; i < _endpoints.length; i++) + { + newEndpoints[i] = _endpoints[i].timeout(newTimeout); + } + r._endpoints = newEndpoints; + } return r; } public Reference changeConnectionId(String connectionId) { - DirectReference r = (DirectReference)getInstance().referenceFactory().copy(this); - EndpointI[] newEndpoints = new EndpointI[_endpoints.length]; - for(int i = 0; i < _endpoints.length; i++) - { - newEndpoints[i] = _endpoints[i].connectionId(connectionId); - } - r._endpoints = newEndpoints; + DirectReference r = (DirectReference)super.changeConnectionId(connectionId); + if(r != this) // Also override the connection id on the endpoints if it was updated. + { + EndpointI[] newEndpoints = new EndpointI[_endpoints.length]; + for(int i = 0; i < _endpoints.length; i++) + { + newEndpoints[i] = _endpoints[i].connectionId(connectionId); + } + r._endpoints = newEndpoints; + } return r; } @@ -114,6 +123,7 @@ public class DirectReference extends RoutableReference DirectReference r = (DirectReference)getInstance().referenceFactory().copy(this); r._endpoints = newEndpoints; + r.applyOverrides(r._endpoints); return r; } @@ -172,9 +182,11 @@ public class DirectReference extends RoutableReference getConnection(Ice.BooleanHolder comp) { EndpointI[] endpts = super.getRoutedEndpoints(); + applyOverrides(endpts); + if(endpts.length == 0) { - endpts = _endpoints; + endpts = _endpoints; // Endpoint overrides are already applied on these endpoints. } Ice.ConnectionI connection = createConnection(endpts, comp); |