diff options
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/IceInternal/ThreadPool.java | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/java/src/IceInternal/ThreadPool.java b/java/src/IceInternal/ThreadPool.java index 020c54ff3e6..d470361aca7 100644 --- a/java/src/IceInternal/ThreadPool.java +++ b/java/src/IceInternal/ThreadPool.java @@ -80,6 +80,8 @@ public final class ThreadPool int size = _instance.initializationData().properties.getPropertyAsIntWithDefault(_prefix + ".Size", 1); if(size < 1) { + String s = _prefix + ".Size < 0; Size adjusted to 1"; + _instance.initializationData().logger.warning(s); size = 1; } @@ -87,11 +89,37 @@ public final class ThreadPool _instance.initializationData().properties.getPropertyAsIntWithDefault(_prefix + ".SizeMax", size); if(sizeMax < size) { + String s = _prefix + ".SizeMax < " + _prefix + ".Size; SizeMax adjusted to Size (" + size + ")"; + _instance.initializationData().logger.warning(s); sizeMax = size; } int sizeWarn = _instance.initializationData().properties.getPropertyAsIntWithDefault( _prefix + ".SizeWarn", sizeMax * 80 / 100); + if(_instance.initializationData().properties.getProperty(_prefix + ".SizeWarn").length() == 0) + { + if(sizeWarn < size) + { + String s = _prefix + ".SizeWarn < " + _prefix + ".Size; adjusted SizeWarn to Size (" + size + ")"; + _instance.initializationData().logger.warning(s); + } + else if(sizeWarn > sizeMax) + { + String s = _prefix + ".SizeWarn > " + _prefix + ".SizeMax; adjusted SizeWarn to SizeMax (" + + sizeMax + ")"; + _instance.initializationData().logger.warning(s); + } + } + + // + // We do this deliberately outside the above test, because sizeMax * 80 / 100 + // can evaluate to something < size, but we want to issue a warning only if + // SizeWarn was explicitly set. + // + if(sizeWarn < size) + { + sizeWarn = size; + } _size = size; _sizeMax = sizeMax; |