Class 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.
    • Constructor Detail

      • PeriodicCleanUpMap

        public PeriodicCleanUpMap​(long runPeriod,
                                  long timeoutPeriod)
        Constructor of PeriodicCleanUpMap.
        Parameters:
        runPeriod - Run period in ms
        timeoutPeriod - timeout period in ms
      • PeriodicCleanUpMap

        public PeriodicCleanUpMap​(long runPeriod,
                                  long timeoutPeriod,
                                  Map map)
                           throws IllegalArgumentException
        Constructor of PeriodicCleanUpMap.
        Parameters:
        runPeriod - Run period in ms
        timeoutPeriod - timeout period in ms
        map - 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:
        run in interface Runnable
        Overrides:
        run in class PeriodicGroupMap