Author: cwiklik
Date: Tue Jan 15 21:19:25 2019
New Revision: 1851412

URL: http://svn.apache.org/viewvc?rev=1851412&view=rev
Log:
UIMA-5959 allow zero for time to wait

Modified:
    
uima/uima-ducc/trunk/uima-ducc-pullservice/src/main/java/org/apache/uima/ducc/ps/service/protocol/builtin/DefaultNoTaskAvailableStrategy.java

Modified: 
uima/uima-ducc/trunk/uima-ducc-pullservice/src/main/java/org/apache/uima/ducc/ps/service/protocol/builtin/DefaultNoTaskAvailableStrategy.java
URL: 
http://svn.apache.org/viewvc/uima/uima-ducc/trunk/uima-ducc-pullservice/src/main/java/org/apache/uima/ducc/ps/service/protocol/builtin/DefaultNoTaskAvailableStrategy.java?rev=1851412&r1=1851411&r2=1851412&view=diff
==============================================================================
--- 
uima/uima-ducc/trunk/uima-ducc-pullservice/src/main/java/org/apache/uima/ducc/ps/service/protocol/builtin/DefaultNoTaskAvailableStrategy.java
 (original)
+++ 
uima/uima-ducc/trunk/uima-ducc-pullservice/src/main/java/org/apache/uima/ducc/ps/service/protocol/builtin/DefaultNoTaskAvailableStrategy.java
 Tue Jan 15 21:19:25 2019
@@ -26,14 +26,11 @@ import java.util.concurrent.locks.Reentr
 import org.apache.uima.ducc.ps.service.protocol.INoTaskAvailableStrategy;
 
 public class DefaultNoTaskAvailableStrategy implements 
INoTaskAvailableStrategy {
-       private int waitTime = 30;   // default
+       private int waitTime;   
        private final ReentrantLock lock = new ReentrantLock();
        
        public DefaultNoTaskAvailableStrategy(int waitTimeInSecs) {
-               // if wait time not specified use default
-               if ( waitTimeInSecs > 0 ) {
-                       this.waitTime = waitTimeInSecs;
-               }
+               this.waitTime = waitTimeInSecs;
        }
        /**
         * This methods is called when a service is stopping. There is no
@@ -50,7 +47,7 @@ public class DefaultNoTaskAvailableStrat
                Condition waitAwhileCondition = lock.newCondition();
                try {
                        lock.lock();
-                       // wait only it wait time > 0. No indefinite wait 
supported
+                       // wait only if wait time > 0. Indefinite wait is not 
supported. If waitTime=0, it means no wait
                        if ( waitTime > 0 ) {
                                try {
                                        waitAwhileCondition.await(waitTime, 
TimeUnit.SECONDS);


Reply via email to