diff options
author | Marc Laukien <marc@zeroc.com> | 2002-06-21 17:36:32 +0000 |
---|---|---|
committer | Marc Laukien <marc@zeroc.com> | 2002-06-21 17:36:32 +0000 |
commit | 2e4cb7ff2b8ad6b6896e5f39712ad5b412c2012d (patch) | |
tree | 7804c9dfb7e17a82b61b9a8c907f95ac8eb1dad9 /java | |
parent | fixes (diff) | |
download | ice-2e4cb7ff2b8ad6b6896e5f39712ad5b412c2012d.tar.bz2 ice-2e4cb7ff2b8ad6b6896e5f39712ad5b412c2012d.tar.xz ice-2e4cb7ff2b8ad6b6896e5f39712ad5b412c2012d.zip |
fix
Diffstat (limited to 'java')
-rw-r--r-- | java/src/Ice/ObjectAdapterI.java | 37 | ||||
-rw-r--r-- | java/src/IceInternal/IncomingConnectionFactory.java | 14 |
2 files changed, 25 insertions, 26 deletions
diff --git a/java/src/Ice/ObjectAdapterI.java b/java/src/Ice/ObjectAdapterI.java index 1ecd4589865..b1451a7352d 100644 --- a/java/src/Ice/ObjectAdapterI.java +++ b/java/src/Ice/ObjectAdapterI.java @@ -27,7 +27,7 @@ public class ObjectAdapterI implements ObjectAdapter public synchronized void activate() { - if (_deactivated) + if (_instance == null) { throw new ObjectAdapterDeactivatedException(); } @@ -54,7 +54,7 @@ public class ObjectAdapterI implements ObjectAdapter public synchronized void hold() { - if (_deactivated) + if (_instance == null) { throw new ObjectAdapterDeactivatedException(); } @@ -71,7 +71,7 @@ public class ObjectAdapterI implements ObjectAdapter public synchronized void deactivate() { - if (_deactivated) + if (_instance == null) { // // Ignore deactivation requests if the Object Adapter has @@ -100,7 +100,7 @@ public class ObjectAdapterI implements ObjectAdapter } _locatorMap.clear(); - _deactivated = true; + _instance = null; } public void @@ -123,7 +123,7 @@ public class ObjectAdapterI implements ObjectAdapter public synchronized ObjectPrx add(Ice.Object servant, Identity ident) { - if (_deactivated) + if (_instance == null) { throw new ObjectAdapterDeactivatedException(); } @@ -143,7 +143,7 @@ public class ObjectAdapterI implements ObjectAdapter public synchronized ObjectPrx addWithUUID(Ice.Object servant) { - if (_deactivated) + if (_instance == null) { throw new ObjectAdapterDeactivatedException(); } @@ -161,7 +161,7 @@ public class ObjectAdapterI implements ObjectAdapter public synchronized void remove(Identity ident) { - if (_deactivated) + if (_instance == null) { throw new ObjectAdapterDeactivatedException(); } @@ -172,7 +172,7 @@ public class ObjectAdapterI implements ObjectAdapter public synchronized void addServantLocator(ServantLocator locator, String prefix) { - if (_deactivated) + if (_instance == null) { throw new ObjectAdapterDeactivatedException(); } @@ -183,7 +183,7 @@ public class ObjectAdapterI implements ObjectAdapter public synchronized void removeServantLocator(String prefix) { - if (_deactivated) + if (_instance == null) { throw new ObjectAdapterDeactivatedException(); } @@ -198,7 +198,7 @@ public class ObjectAdapterI implements ObjectAdapter public synchronized ServantLocator findServantLocator(String prefix) { - if (_deactivated) + if (_instance == null) { throw new ObjectAdapterDeactivatedException(); } @@ -222,7 +222,7 @@ public class ObjectAdapterI implements ObjectAdapter public synchronized ObjectPrx createProxy(Identity ident) { - if (_deactivated) + if (_instance == null) { throw new ObjectAdapterDeactivatedException(); } @@ -233,7 +233,7 @@ public class ObjectAdapterI implements ObjectAdapter public synchronized ObjectPrx createReverseProxy(Identity ident) { - if (_deactivated) + if (_instance == null) { throw new ObjectAdapterDeactivatedException(); } @@ -252,7 +252,7 @@ public class ObjectAdapterI implements ObjectAdapter public synchronized void addRouter(RouterPrx router) { - if (_deactivated) + if (_instance == null) { throw new ObjectAdapterDeactivatedException(); } @@ -328,7 +328,6 @@ public class ObjectAdapterI implements ObjectAdapter ObjectAdapterI(IceInternal.Instance instance, String name, String endpts) { _instance = instance; - _deactivated = false; _printAdapterReadyDone = false; _name = name; @@ -372,10 +371,7 @@ public class ObjectAdapterI implements ObjectAdapter } catch (LocalException ex) { - if (!_deactivated) - { - deactivate(); - } + deactivate(); throw ex; } @@ -396,9 +392,9 @@ public class ObjectAdapterI implements ObjectAdapter finalize() throws Throwable { - if (!_deactivated) + if (_instance != null) { - deactivate(); + _instance.logger().warning("object adapter has not been deactivated"); } super.finalize(); @@ -496,7 +492,6 @@ public class ObjectAdapterI implements ObjectAdapter } private IceInternal.Instance _instance; - private boolean _deactivated; private boolean _printAdapterReadyDone; private String _name; private java.util.HashMap _activeServantMap = new java.util.HashMap(); diff --git a/java/src/IceInternal/IncomingConnectionFactory.java b/java/src/IceInternal/IncomingConnectionFactory.java index 09b05bfba4c..5ef462b063b 100644 --- a/java/src/IceInternal/IncomingConnectionFactory.java +++ b/java/src/IceInternal/IncomingConnectionFactory.java @@ -175,7 +175,13 @@ public class IncomingConnectionFactory extends EventHandler _acceptor.close(); - _finished = true; + // + // Break cyclic object dependency. This is necessary, + // because the object adapter never clears the list of + // incoming connections it keeps. + // + _adapter = null; + notifyAll(); // For waitUntilFinished(). } } @@ -211,7 +217,6 @@ public class IncomingConnectionFactory extends EventHandler _adapter = adapter; _state = StateHolding; _warn = _instance.properties().getPropertyAsInt("Ice.ConnectionWarnings") > 0 ? true : false; - _finished = false; _registeredWithPool = false; try @@ -246,7 +251,7 @@ public class IncomingConnectionFactory extends EventHandler throws Throwable { assert(_state == StateClosed); - assert(_finished); + assert(_adapter == null); // // Destroy the EventHandler's stream, so that its buffer @@ -266,7 +271,7 @@ public class IncomingConnectionFactory extends EventHandler public synchronized void waitUntilFinished() { - while (!_finished) + while (_adapter != null) { try { @@ -404,6 +409,5 @@ public class IncomingConnectionFactory extends EventHandler private java.util.LinkedList _connections = new java.util.LinkedList(); private int _state; private boolean _warn; - private boolean _finished; private boolean _registeredWithPool; } |