Package org.jboss.util.threadpool
Class BasicThreadPool.TimeoutInfo
- java.lang.Object
-
- org.jboss.util.threadpool.BasicThreadPool.TimeoutInfo
-
- All Implemented Interfaces:
java.lang.Comparable
- Enclosing class:
- BasicThreadPool
private static class BasicThreadPool.TimeoutInfo extends java.lang.Object implements java.lang.ComparableAn encapsulation of a task and its completion timeout
-
-
Field Summary
Fields Modifier and Type Field Description (package private) booleanfirstStop(package private) longstart(package private) longtimeoutMS(package private) TaskWrapperwrapper
-
Constructor Summary
Constructors Constructor Description TimeoutInfo(TaskWrapper wrapper, long timeout)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(java.lang.Object o)Order TimeoutInfo based on the timestamp at which the task needs to be completed by.longgetTaskCompletionTimeout()longgetTaskCompletionTimeout(long now)Get the time remaining to the complete timeout timestamp in MS.(package private) TaskWrappergetTaskWrapper()voidsetTimeout(long timeout)booleanstopTask()Invoke stopTask on the wrapper and indicate whether this was the first time the task has been notified to stop.
-
-
-
Field Detail
-
start
long start
-
timeoutMS
long timeoutMS
-
wrapper
TaskWrapper wrapper
-
firstStop
boolean firstStop
-
-
Constructor Detail
-
TimeoutInfo
TimeoutInfo(TaskWrapper wrapper, long timeout)
-
-
Method Detail
-
setTimeout
public void setTimeout(long timeout)
-
compareTo
public int compareTo(java.lang.Object o)
Order TimeoutInfo based on the timestamp at which the task needs to be completed by.- Specified by:
compareToin interfacejava.lang.Comparable- Parameters:
o- a TimeoutInfo- Returns:
- the diff between this timeoutMS and the argument timeoutMS
-
getTaskWrapper
TaskWrapper getTaskWrapper()
-
getTaskCompletionTimeout
public long getTaskCompletionTimeout()
-
getTaskCompletionTimeout
public long getTaskCompletionTimeout(long now)
Get the time remaining to the complete timeout timestamp in MS.- Parameters:
now- - the current System.currentTimeMillis value- Returns:
- the time remaining to the complete timeout timestamp in MS.
-
stopTask
public boolean stopTask()
Invoke stopTask on the wrapper and indicate whether this was the first time the task has been notified to stop.- Returns:
- true if this is the first stopTask, false on the second.
-
-