diff options
author | Marc Laukien <marc@zeroc.com> | 2003-03-23 13:38:32 +0000 |
---|---|---|
committer | Marc Laukien <marc@zeroc.com> | 2003-03-23 13:38:32 +0000 |
commit | 11b7b77c8ab31336201048063f38097f8b8e55a5 (patch) | |
tree | 172265dad500a489f968d58e79a1f6b0a255d691 /java | |
parent | monitor fix (diff) | |
download | ice-11b7b77c8ab31336201048063f38097f8b8e55a5.tar.bz2 ice-11b7b77c8ab31336201048063f38097f8b8e55a5.tar.xz ice-11b7b77c8ab31336201048063f38097f8b8e55a5.zip |
shutdown fix
Diffstat (limited to 'java')
-rw-r--r-- | java/CHANGES | 4 | ||||
-rw-r--r-- | java/src/IceInternal/Instance.java | 86 |
2 files changed, 88 insertions, 2 deletions
diff --git a/java/CHANGES b/java/CHANGES index 6d99517a33c..1d44f1713be 100644 --- a/java/CHANGES +++ b/java/CHANGES @@ -1,6 +1,10 @@ Changes since version 1.0.1 --------------------------- +- In some cases, communicator destruction could result in a + java.lang.NullPointerException. This has been fixed. Now a + CommunicatorDestroyedException is raised. + - Fixed a bug with AMD methods using a servant locator, such as the Freeze evictor. diff --git a/java/src/IceInternal/Instance.java b/java/src/IceInternal/Instance.java index 23b5bbd8a11..11fd4eb2493 100644 --- a/java/src/IceInternal/Instance.java +++ b/java/src/IceInternal/Instance.java @@ -26,24 +26,44 @@ public class Instance public synchronized Ice.Logger logger() { + if(_destroyed) + { + throw new Ice.CommunicatorDestroyedException(); + } + return _logger; } public synchronized void logger(Ice.Logger logger) { + if(_destroyed) + { + throw new Ice.CommunicatorDestroyedException(); + } + _logger = logger; } public synchronized Ice.Stats stats() { + if(_destroyed) + { + throw new Ice.CommunicatorDestroyedException(); + } + return _stats; } public synchronized void stats(Ice.Stats stats) { + if(_destroyed) + { + throw new Ice.CommunicatorDestroyedException(); + } + _stats = stats; } @@ -64,61 +84,109 @@ public class Instance public synchronized RouterManager routerManager() { + if(_destroyed) + { + throw new Ice.CommunicatorDestroyedException(); + } + return _routerManager; } public synchronized LocatorManager locatorManager() { + if(_destroyed) + { + throw new Ice.CommunicatorDestroyedException(); + } + return _locatorManager; } public synchronized ReferenceFactory referenceFactory() { + if(_destroyed) + { + throw new Ice.CommunicatorDestroyedException(); + } + return _referenceFactory; } public synchronized ProxyFactory proxyFactory() { + if(_destroyed) + { + throw new Ice.CommunicatorDestroyedException(); + } + return _proxyFactory; } public synchronized OutgoingConnectionFactory outgoingConnectionFactory() { + if(_destroyed) + { + throw new Ice.CommunicatorDestroyedException(); + } + return _outgoingConnectionFactory; } public synchronized ConnectionMonitor connectionMonitor() { + if(_destroyed) + { + throw new Ice.CommunicatorDestroyedException(); + } + return _connectionMonitor; } public synchronized ObjectFactoryManager servantFactoryManager() { + if(_destroyed) + { + throw new Ice.CommunicatorDestroyedException(); + } + return _servantFactoryManager; } public synchronized UserExceptionFactoryManager userExceptionFactoryManager() { + if(_destroyed) + { + throw new Ice.CommunicatorDestroyedException(); + } + return _userExceptionFactoryManager; } public synchronized ObjectAdapterFactory objectAdapterFactory() { + if(_destroyed) + { + throw new Ice.CommunicatorDestroyedException(); + } + return _objectAdapterFactory; } public synchronized ThreadPool clientThreadPool() { - assert(!_destroyed); + if(_destroyed) + { + throw new Ice.CommunicatorDestroyedException(); + } if(_clientThreadPool == null) // Lazy initialization. { @@ -148,7 +216,10 @@ public class Instance public synchronized ThreadPool serverThreadPool() { - assert(!_destroyed); + if(_destroyed) + { + throw new Ice.CommunicatorDestroyedException(); + } if(_serverThreadPool == null) // Lazy initialization. { @@ -162,12 +233,22 @@ public class Instance public synchronized EndpointFactoryManager endpointFactoryManager() { + if(_destroyed) + { + throw new Ice.CommunicatorDestroyedException(); + } + return _endpointFactoryManager; } public synchronized Ice.PluginManager pluginManager() { + if(_destroyed) + { + throw new Ice.CommunicatorDestroyedException(); + } + return _pluginManager; } @@ -328,6 +409,7 @@ public class Instance synchronized(this) { _objectAdapterFactory = null; + _outgoingConnectionFactory = null; if(_connectionMonitor != null) |