Package com.sun.identity.common
Class PeriodicGroupRunnable
- java.lang.Object
-
- com.sun.identity.common.GeneralTaskRunnable
-
- com.sun.identity.common.PeriodicRunnable
-
- com.sun.identity.common.PeriodicGroupRunnable
-
- All Implemented Interfaces:
ScheduleableGroupAction
,TaskRunnable
,Runnable
- Direct Known Subclasses:
FSRequestCleanUpRunnable
,PeriodicGroupMap
public class PeriodicGroupRunnable extends PeriodicRunnable implements ScheduleableGroupAction
Periodic task (task will be run periodically) which has handler separated (share the same ScheduleableGroupAction) can be scheduled to Timer or TimerPool by using PeriodicGroupRunnable. All the elements in the same PeriodicGroupRunnable must have the same timeout period and run period. Elements will be grouped by using the time they enter PeriodicGroupRunnable. ScheduleableGroupAction will only go through the elements which entered PeriodicGroupRunnable excess the timeout time.
-
-
Field Summary
Fields Modifier and Type Field Description protected ScheduleableGroupAction
target
-
Fields inherited from class com.sun.identity.common.PeriodicRunnable
containerNeeded, nextTurn, removeElementAfterAction, runPeriod, thisTurn, timeoutPeriod
-
Fields inherited from class com.sun.identity.common.GeneralTaskRunnable
headTask, nextTask, previousTask
-
-
Constructor Summary
Constructors Constructor Description PeriodicGroupRunnable(ScheduleableGroupAction target, long runPeriod, long timeoutPeriod, boolean removeElementAfterAction)
Constructor of PeriodicGroupRunnable.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
doGroupAction(Object obj)
The function to be run on the objects when there is time.void
run()
Implements for TaskRunnable.-
Methods inherited from class com.sun.identity.common.PeriodicRunnable
addElement, getRunPeriod, getTimeoutPeriod, isEmpty, removeElement
-
Methods inherited from class com.sun.identity.common.GeneralTaskRunnable
cancel, getHeadTask, isScheduled, next, previous, scheduledExecutionTime, setHeadTask, setNext, setPrevious
-
-
-
-
Field Detail
-
target
protected ScheduleableGroupAction target
-
-
Constructor Detail
-
PeriodicGroupRunnable
public PeriodicGroupRunnable(ScheduleableGroupAction target, long runPeriod, long timeoutPeriod, boolean removeElementAfterAction) throws IllegalArgumentException
Constructor of PeriodicGroupRunnable.- Parameters:
target
- The ScheduleableGroupAction interface to be run on the objects when there is timerunPeriod
- Run period in mstimeoutPeriod
- timeout period in msremoveElementAfterAction
- Whether to remove the elements after running the ScheduleableGroupAction on the objects- Throws:
IllegalArgumentException
-
-
Method Detail
-
doGroupAction
public void doGroupAction(Object obj)
The function to be run on the objects when there is time.- Specified by:
doGroupAction
in interfaceScheduleableGroupAction
- Parameters:
obj
- The object the function act on
-
run
public void run()
Implements for TaskRunnable. Run the function of ScheduleableGroupAction on the objects in thisTurn 1 by 1, and interchange thisTurn and nextTurn.- Specified by:
run
in interfaceRunnable
- Overrides:
run
in classPeriodicRunnable
-
-