Package org.teiid.jdbc
Class EnhancedTimer
- java.lang.Object
-
- org.teiid.jdbc.EnhancedTimer
-
public class EnhancedTimer extends Object
Specialized timer that can purge tasks in lg(n) time Will only hold a thread while there are pending tasks.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
EnhancedTimer.Task
-
Constructor Summary
Constructors Constructor Description EnhancedTimer(String name)
Constructs a new Timer that directly executes tasks off of a single-thread thread pool.EnhancedTimer(Executor bossExecutor, Executor taskExecutor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EnhancedTimer.Task
add(Runnable task, long delay)
Add a delayed taskint
getQueueSize()
-
-
-
Method Detail
-
add
public EnhancedTimer.Task add(Runnable task, long delay)
Add a delayed task- Parameters:
task
-delay
- in ms- Returns:
- a cancellable Task
-
getQueueSize
public int getQueueSize()
-
-