org.apertereports.util.cache
Class MapCacheManager

java.lang.Object
  extended by org.apertereports.util.cache.MapCacheManager

public final class MapCacheManager
extends Object

A utility for handling cache expiration. Periodically checks the cache for invalid objects with a single thread.


Nested Class Summary
static class MapCacheManager.InvalidatingThread
          A cache invalidating thread.
 
Method Summary
static void invalidateAllCaches()
          Clears all registered caches from all objects and the interval map.
static void objectCached(MapCache cache, String key, long interval)
          Registers an object for periodic interval check.
static void objectProvided(MapCache cache, String key)
          Indicates the object was provided by one of the registered caches.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

objectProvided

public static void objectProvided(MapCache cache,
                                  String key)
Indicates the object was provided by one of the registered caches. If the cache was not registered before it is added to the cache control map.

Parameters:
cache - The MapCache that provided the object
key - Object key

objectCached

public static void objectCached(MapCache cache,
                                String key,
                                long interval)
Registers an object for periodic interval check.

Parameters:
cache - The MapCache that cached the object
key - Object key
interval - Interval the cache is valid for

invalidateAllCaches

public static void invalidateAllCaches()
Clears all registered caches from all objects and the interval map.



Copyright © 2011-2012. All Rights Reserved.