diff options
author | Benoit Foucher <benoit@zeroc.com> | 2007-11-27 11:58:35 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2007-11-27 11:58:35 +0100 |
commit | 47f800495093fd7679a315e2d730fea22f6135b7 (patch) | |
tree | a7b8d3488f3841367dd03d10cae293f36fd10481 /java/test/Ice/background/Configuration.java | |
parent | Fixed SystemException to no longer derive from LocalException (diff) | |
download | ice-47f800495093fd7679a315e2d730fea22f6135b7.tar.bz2 ice-47f800495093fd7679a315e2d730fea22f6135b7.tar.xz ice-47f800495093fd7679a315e2d730fea22f6135b7.zip |
- Added support for non-blocking AMI/batch requests, connection
creation.
- Added support for AMI oneway requests.
- Changed collocation optimization to not perform any DNS lookups.
Diffstat (limited to 'java/test/Ice/background/Configuration.java')
-rw-r--r-- | java/test/Ice/background/Configuration.java | 161 |
1 files changed, 161 insertions, 0 deletions
diff --git a/java/test/Ice/background/Configuration.java b/java/test/Ice/background/Configuration.java new file mode 100644 index 00000000000..192d99fc1f6 --- /dev/null +++ b/java/test/Ice/background/Configuration.java @@ -0,0 +1,161 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2007 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. +// +// ********************************************************************** + +public final class Configuration +{ + public synchronized void + connectorsException(Ice.LocalException ex) + { + _connectorsException = ex; + } + + public synchronized void + checkConnectorsException() + { + if(_connectorsException != null) + { + throw _connectorsException; + } + } + + public synchronized void + connectException(Ice.LocalException ex) + { + _connectException = ex; + } + + public synchronized void + checkConnectException() + { + if(_connectException != null) + { + throw _connectException; + } + } + + public synchronized void + initializeSocketStatus(IceInternal.SocketStatus status) + { + if(status == IceInternal.SocketStatus.Finished) + { + _initializeResetCount = 0; + return; + } + _initializeResetCount = 10; + _initializeSocketStatus = status; + } + + public synchronized void + initializeException(Ice.LocalException ex) + { + _initializeException = ex; + } + + public synchronized IceInternal.SocketStatus + initializeSocketStatus() + { + if(_initializeResetCount == 0) + { + return IceInternal.SocketStatus.Finished; + } + --_initializeResetCount; + return _initializeSocketStatus; + } + + public synchronized void + checkInitializeException() + { + if(_initializeException != null) + { + throw _initializeException; + } + } + + public synchronized void + readReady(boolean ready) + { + _readReadyCount = ready ? 0 : 10; + } + + public synchronized void + readException(Ice.LocalException ex) + { + _readException = ex; + } + + public synchronized boolean + readReady() + { + if(_readReadyCount == 0) + { + return true; + } + --_readReadyCount; + return false; + } + + public synchronized void + checkReadException() + { + if(_readException != null) + { + throw _readException; + } + } + + public synchronized void + writeReady(boolean ready) + { + _writeReadyCount = ready ? 0 : 10; + } + + public synchronized void + writeException(Ice.LocalException ex) + { + _writeException = ex; + } + + public synchronized boolean + writeReady() + { + if(_writeReadyCount == 0) + { + return true; + } + --_writeReadyCount; + return false; + } + + public synchronized void + checkWriteException() + { + if(_writeException != null) + { + throw _writeException; + } + } + + static public synchronized Configuration + getInstance() + { + return _instance; + } + + private Ice.LocalException _connectorsException; + private Ice.LocalException _connectException; + private IceInternal.SocketStatus _initializeSocketStatus; + private int _initializeResetCount; + private Ice.LocalException _initializeException; + private int _readReadyCount; + private Ice.LocalException _readException; + private int _writeReadyCount; + private Ice.LocalException _writeException; + + private final static Configuration _instance = new Configuration(); +} |