diff options
author | Marc Laukien <marc@zeroc.com> | 2004-10-21 18:58:04 +0000 |
---|---|---|
committer | Marc Laukien <marc@zeroc.com> | 2004-10-21 18:58:04 +0000 |
commit | 80d153dcde86a890fc63c147ac47dabb6af91570 (patch) | |
tree | e5eb53835dda09f97c8b04eb294792bb56b6f4e4 /java/src | |
parent | demo build.xml now use Ice.jar (and db.jar if present), which is more (diff) | |
download | ice-80d153dcde86a890fc63c147ac47dabb6af91570.tar.bz2 ice-80d153dcde86a890fc63c147ac47dabb6af91570.tar.xz ice-80d153dcde86a890fc63c147ac47dabb6af91570.zip |
timeout for clientProxy / ice_connection
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/Ice/ConnectionI.java | 15 | ||||
-rw-r--r-- | java/src/Ice/ObjectPrx.java | 2 | ||||
-rw-r--r-- | java/src/Ice/ObjectPrxHelperBase.java | 4 | ||||
-rw-r--r-- | java/src/Ice/_ObjectDel.java | 2 | ||||
-rw-r--r-- | java/src/Ice/_ObjectDelD.java | 2 | ||||
-rw-r--r-- | java/src/Ice/_ObjectDelM.java | 2 | ||||
-rw-r--r-- | java/src/IceInternal/RouterInfo.java | 18 |
7 files changed, 30 insertions, 15 deletions
diff --git a/java/src/Ice/ConnectionI.java b/java/src/Ice/ConnectionI.java index 8409ba88d75..640e89b815a 100644 --- a/java/src/Ice/ConnectionI.java +++ b/java/src/Ice/ConnectionI.java @@ -886,13 +886,6 @@ public final class ConnectionI extends IceInternal.EventHandler implements Conne } } - public int - timeout() - { - // No mutex protection necessary, _endpoint is immutable. - return _endpoint.timeout(); - } - public IceInternal.Endpoint endpoint() { @@ -1372,7 +1365,13 @@ public final class ConnectionI extends IceInternal.EventHandler implements Conne public String type() { - return _type; + return _type; // No mutex lock, _type is immutable. + } + + public int + timeout() + { + return _endpoint.timeout(); // No mutex protection necessary, _endpoint is immutable. } public String diff --git a/java/src/Ice/ObjectPrx.java b/java/src/Ice/ObjectPrx.java index fde50e2948f..e22142c9a90 100644 --- a/java/src/Ice/ObjectPrx.java +++ b/java/src/Ice/ObjectPrx.java @@ -62,7 +62,7 @@ public interface ObjectPrx ObjectPrx ice_collocationOptimization(boolean b); ObjectPrx ice_default(); - Connection ice_getConnection(); + Connection ice_connection(); boolean equals(java.lang.Object r); } diff --git a/java/src/Ice/ObjectPrxHelperBase.java b/java/src/Ice/ObjectPrxHelperBase.java index 71e47fbedc6..aaedfd92126 100644 --- a/java/src/Ice/ObjectPrxHelperBase.java +++ b/java/src/Ice/ObjectPrxHelperBase.java @@ -481,7 +481,7 @@ public class ObjectPrxHelperBase implements ObjectPrx } public final Connection - ice_getConnection() + ice_connection() { int __cnt = 0; while(true) @@ -489,7 +489,7 @@ public class ObjectPrxHelperBase implements ObjectPrx try { _ObjectDel __del = __getDelegate(); - return __del.ice_getConnection(); + return __del.ice_connection(); } catch(LocalException __ex) { diff --git a/java/src/Ice/_ObjectDel.java b/java/src/Ice/_ObjectDel.java index be236baf9eb..b563ed14a0e 100644 --- a/java/src/Ice/_ObjectDel.java +++ b/java/src/Ice/_ObjectDel.java @@ -27,5 +27,5 @@ public interface _ObjectDel java.util.Map context) throws IceInternal.NonRepeatable; - Connection ice_getConnection(); + Connection ice_connection(); } diff --git a/java/src/Ice/_ObjectDelD.java b/java/src/Ice/_ObjectDelD.java index 3f63f5acee7..58d86295b4d 100644 --- a/java/src/Ice/_ObjectDelD.java +++ b/java/src/Ice/_ObjectDelD.java @@ -101,7 +101,7 @@ public class _ObjectDelD implements _ObjectDel } public Connection - ice_getConnection() + ice_connection() { throw new CollocationOptimizationException(); } diff --git a/java/src/Ice/_ObjectDelM.java b/java/src/Ice/_ObjectDelM.java index 904246bda55..2e2831061a9 100644 --- a/java/src/Ice/_ObjectDelM.java +++ b/java/src/Ice/_ObjectDelM.java @@ -150,7 +150,7 @@ public class _ObjectDelM implements _ObjectDel } public Connection - ice_getConnection() + ice_connection() { return __connection; } diff --git a/java/src/IceInternal/RouterInfo.java b/java/src/IceInternal/RouterInfo.java index 8d3d28af230..6dfbbdb4797 100644 --- a/java/src/IceInternal/RouterInfo.java +++ b/java/src/IceInternal/RouterInfo.java @@ -63,7 +63,15 @@ public final class RouterInfo { throw new Ice.NoEndpointException(); } - _clientProxy = _clientProxy.ice_router(null); // The client proxy cannot be routed. + + _clientProxy = _clientProxy.ice_router(null); // The client proxy cannot be routed. + + // + // In order to avoid creating a new connection to the + // router, we must use the same timeout as the already + // existing connection. + // + _clientProxy = _clientProxy.ice_timeout(_router.ice_connection().timeout()); } return _clientProxy; @@ -73,6 +81,13 @@ public final class RouterInfo setClientProxy(Ice.ObjectPrx clientProxy) { _clientProxy = clientProxy.ice_router(null); // The client proxy cannot be routed. + + // + // In order to avoid creating a new connection to the router, + // we must use the same timeout as the already existing + // connection. + // + _clientProxy = _clientProxy.ice_timeout(_router.ice_connection().timeout()); } public Ice.ObjectPrx @@ -85,6 +100,7 @@ public final class RouterInfo { throw new Ice.NoEndpointException(); } + _serverProxy = _serverProxy.ice_router(null); // The server proxy cannot be routed. } |