Package com.sun.identity.common
Class TimerPool
- java.lang.Object
-
- com.sun.identity.common.TimerPool
-
- All Implemented Interfaces:
Triggerable
public class TimerPool extends Object implements Triggerable
TimerPool is a scheduleable version of ThreadPool.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidschedule(TaskRunnable task, long delay)Schedules the TaskRunnable to the TimerPool.voidschedule(TaskRunnable task, Date time)Schedules a TaskRunnable to the TimerPool.voidshutdown()Shuts down the TimerPool.voidtrigger(Date time)Implements the trigger function for Triggerable interface.
-
-
-
Constructor Detail
-
TimerPool
public TimerPool(String name, int poolSize, boolean daemon, Debug debug)
Constructor of TimerPool.- Parameters:
name- The name of the TimerPoolpoolSize- The size of the TimerPooldaemon- The boolean to indicate whether the threads in TimerPool are daemondebug- Debug object to send debugging message to.
-
-
Method Detail
-
schedule
public void schedule(TaskRunnable task, Date time) throws IllegalArgumentException, IllegalStateException
Schedules a TaskRunnable to the TimerPool.- Parameters:
task- The TaskRunnable to be scheduledtime- The time to run the TaskRunnable- Throws:
IllegalArgumentExceptionIllegalStateException
-
schedule
public void schedule(TaskRunnable task, long delay) throws IllegalArgumentException, IllegalStateException
Schedules the TaskRunnable to the TimerPool.- Parameters:
task- The TaskRunnable to be scheduleddelay- The time (in ms) to wait before running the task- Throws:
IllegalArgumentExceptionIllegalStateException
-
trigger
public void trigger(Date time)
Implements the trigger function for Triggerable interface.- Specified by:
triggerin interfaceTriggerable- Parameters:
time- The time the HeadTaskRunnable scheduled
-
shutdown
public void shutdown()
Shuts down the TimerPool.
-
-