Package com.sun.identity.common
Class PeriodicCleanUpMap
- java.lang.Object
-
- com.sun.identity.common.GeneralTaskRunnable
-
- com.sun.identity.common.PeriodicRunnable
-
- com.sun.identity.common.PeriodicGroupRunnable
-
- com.sun.identity.common.PeriodicGroupMap
-
- com.sun.identity.common.PeriodicCleanUpMap
-
- All Implemented Interfaces:
ScheduleableGroupAction,TaskRunnable,Runnable,Map
public class PeriodicCleanUpMap extends PeriodicGroupMap
PeriodicCleanUpMap is a general Map and a scheduleable unit. Elements pairs will be grouped by using the time they enter the map. PeriodicCleanUpMap can be scheduled to Timer or TimerPool. For every run period, The map will remove the elements which are timeout.
-
-
Field Summary
-
Fields inherited from class com.sun.identity.common.PeriodicGroupMap
map
-
Fields inherited from class com.sun.identity.common.PeriodicGroupRunnable
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 PeriodicCleanUpMap(long runPeriod, long timeoutPeriod)Constructor of PeriodicCleanUpMap.PeriodicCleanUpMap(long runPeriod, long timeoutPeriod, Map map)Constructor of PeriodicCleanUpMap.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidrun()Remove the timed out elements in the map and swap the containers.-
Methods inherited from class com.sun.identity.common.PeriodicGroupMap
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values
-
Methods inherited from class com.sun.identity.common.PeriodicGroupRunnable
doGroupAction
-
Methods inherited from class com.sun.identity.common.PeriodicRunnable
addElement, getRunPeriod, getTimeoutPeriod, removeElement
-
Methods inherited from class com.sun.identity.common.GeneralTaskRunnable
cancel, getHeadTask, isScheduled, next, previous, scheduledExecutionTime, setHeadTask, setNext, setPrevious
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
-
-
-
Constructor Detail
-
PeriodicCleanUpMap
public PeriodicCleanUpMap(long runPeriod, long timeoutPeriod)Constructor of PeriodicCleanUpMap.- Parameters:
runPeriod- Run period in mstimeoutPeriod- timeout period in ms
-
PeriodicCleanUpMap
public PeriodicCleanUpMap(long runPeriod, long timeoutPeriod, Map map) throws IllegalArgumentExceptionConstructor of PeriodicCleanUpMap.- Parameters:
runPeriod- Run period in mstimeoutPeriod- timeout period in msmap- The synchronized map to use- Throws:
IllegalArgumentException
-
-
Method Detail
-
run
public void run()
Remove the timed out elements in the map and swap the containers.- Specified by:
runin interfaceRunnable- Overrides:
runin classPeriodicGroupMap
-
-