diff options
Diffstat (limited to 'java/src/IceInternal/Instance.java')
-rw-r--r-- | java/src/IceInternal/Instance.java | 36 |
1 files changed, 31 insertions, 5 deletions
diff --git a/java/src/IceInternal/Instance.java b/java/src/IceInternal/Instance.java index 1ee242ba63c..1764476cf1d 100644 --- a/java/src/IceInternal/Instance.java +++ b/java/src/IceInternal/Instance.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. @@ -201,6 +201,17 @@ public final class Instance return _endpointHostResolver; } + synchronized public RetryQueue + retryQueue() + { + if(_state == StateDestroyed) + { + throw new Ice.CommunicatorDestroyedException(); + } + + return _retryQueue; + } + synchronized public Timer timer() { @@ -545,7 +556,7 @@ public final class Instance setLogger(Ice.Logger logger) { // - // No locking, as it can only be called during plugin loading + // No locking, as it can only be called during plug-in loading // _initData.logger = logger; } @@ -673,7 +684,7 @@ public final class Instance _routerManager = new RouterManager(); - _locatorManager = new LocatorManager(); + _locatorManager = new LocatorManager(_initData.properties); _referenceFactory = new ReferenceFactory(this, communicator); @@ -713,6 +724,8 @@ public final class Instance _objectAdapterFactory = new ObjectAdapterFactory(this, communicator); + _retryQueue = new RetryQueue(this); + // // Add Process and Properties facets // @@ -753,6 +766,7 @@ public final class Instance IceUtilInternal.Assert.FinalizerAssert(_locatorManager == null); IceUtilInternal.Assert.FinalizerAssert(_endpointFactoryManager == null); IceUtilInternal.Assert.FinalizerAssert(_pluginManager == null); + IceUtilInternal.Assert.FinalizerAssert(_retryQueue == null); super.finalize(); } @@ -789,7 +803,9 @@ public final class Instance } // - // Start connection monitor if necessary. + // Start connection monitor if necessary. Set the check interval to + // 1/10 of the ACM timeout with a minmal value of 1 second and a + // maximum value of 5 minutes. // int interval = 0; if(_clientACM > 0 && _serverACM > 0) @@ -811,6 +827,10 @@ public final class Instance { interval = _serverACM; } + if(interval > 0) + { + interval = java.lang.Math.min(300, java.lang.Math.max(1, (int)interval / 10)); + } interval = _initData.properties.getPropertyAsIntWithDefault("Ice.MonitorConnections", interval); if(interval > 0) { @@ -868,6 +888,11 @@ public final class Instance { _outgoingConnectionFactory.waitUntilFinished(); } + + if(_retryQueue != null) + { + _retryQueue.destroy(); + } ThreadPool serverThreadPool = null; ThreadPool clientThreadPool = null; @@ -877,8 +902,8 @@ public final class Instance synchronized(this) { _objectAdapterFactory = null; - _outgoingConnectionFactory = null; + _retryQueue = null; if(_connectionMonitor != null) { @@ -1054,6 +1079,7 @@ public final class Instance private ThreadPool _serverThreadPool; private SelectorThread _selectorThread; private EndpointHostResolver _endpointHostResolver; + private RetryQueue _retryQueue; private Timer _timer; private EndpointFactoryManager _endpointFactoryManager; private Ice.PluginManager _pluginManager; |