Interface CacheHandler

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void apply​(TreeMap<CacheType<? extends Serializable,​?>,​CacheOperation> operations)
      Apply the given cache operations for each CacheType.
      CustomCache custom​(String name)
      This method is intended to be used by scripts.
      <K extends Serializable,​V>
      Cache<K,​V>
      getCache​(CacheType<K,​V> type)
      Returns the Cache implementation for the given type
      <K extends Serializable,​V>
      Cache<K,​V>
      getCacheIfInitialized​(CacheType<K,​V> type)
      Returns the Cache implementation for the given type if it has already been initialized, or null otherwise
      <K extends Serializable,​V>
      void
      scheduleClear​(CacheType<K,​V> type)
      Schedules a cache clear to be executed after the current transaction has been committed (important to prevent the cache from being reloaded by another thread before the current transaction is committed, populating the cache with a stale value)
      <K extends Serializable,​V>
      void
      scheduleEvict​(CacheType<K,​V> type, Set<K> keys)
      Schedules the eviction of the given cache keys after the current transaction has been committed (important to prevent the cache from being reloaded by another thread before the current transaction is committed, populating the cache with a stale value)
      <K extends Serializable,​V>
      void
      scheduleEvict​(CacheType<K,​V> type, K key)
      Schedules the eviction of an specific cache key after the current transaction has been committed (important to prevent the cache from being reloaded by another thread before the current transaction is committed, populating the cache with a stale value)
      <K extends Serializable,​V>
      void
      schedulePartialEvict​(CacheType<K,​V> type, SerializablePredicate<K> predicate)
      Schedules the eviction of the keys matching the given predicate after the current transaction has been committed (important to prevent the cache from being reloaded by another thread before the current transaction is committed, populating the cache with a stale value)
    • Method Detail

      • getCacheIfInitialized

        <K extends Serializable,​V> Cache<K,​V> getCacheIfInitialized​(CacheType<K,​V> type)
        Returns the Cache implementation for the given type if it has already been initialized, or null otherwise
      • scheduleClear

        <K extends Serializable,​V> void scheduleClear​(CacheType<K,​V> type)
        Schedules a cache clear to be executed after the current transaction has been committed (important to prevent the cache from being reloaded by another thread before the current transaction is committed, populating the cache with a stale value)
      • scheduleEvict

        <K extends Serializable,​V> void scheduleEvict​(CacheType<K,​V> type,
                                                            K key)
        Schedules the eviction of an specific cache key after the current transaction has been committed (important to prevent the cache from being reloaded by another thread before the current transaction is committed, populating the cache with a stale value)
      • scheduleEvict

        <K extends Serializable,​V> void scheduleEvict​(CacheType<K,​V> type,
                                                            Set<K> keys)
        Schedules the eviction of the given cache keys after the current transaction has been committed (important to prevent the cache from being reloaded by another thread before the current transaction is committed, populating the cache with a stale value)
      • schedulePartialEvict

        <K extends Serializable,​V> void schedulePartialEvict​(CacheType<K,​V> type,
                                                                   SerializablePredicate<K> predicate)
        Schedules the eviction of the keys matching the given predicate after the current transaction has been committed (important to prevent the cache from being reloaded by another thread before the current transaction is committed, populating the cache with a stale value)