Interface CacheManager


  • @Role
    public interface CacheManager
    Choose the cache component to use for cache or local cache.
    Since:
    1.7M1
    Version:
    $Id: 3a762b9e6d6fb5ecd6614c41dde293c5ffd0927f $
    • Method Detail

      • getCacheFactory

        CacheFactory getCacheFactory()
                              throws org.xwiki.component.manager.ComponentLookupException
        Lookup the cache creation component with provided hint return it.
        Returns:
        the cache creation service to use.
        Throws:
        org.xwiki.component.manager.ComponentLookupException - error when searching for cache component.
      • getLocalCacheFactory

        CacheFactory getLocalCacheFactory()
                                   throws org.xwiki.component.manager.ComponentLookupException
        Lookup the local cache creation component with provided hint return it.
        Returns:
        the local cache creation service to use.
        Throws:
        org.xwiki.component.manager.ComponentLookupException - error when searching for cache component.
      • createNewCache

        <T> Cache<T> createNewCache​(CacheConfiguration config)
                             throws CacheException
        Find the cache implementation component to use and create a new cache.
        Type Parameters:
        T - the class of the data stored in the cache.
        Parameters:
        config - the cache configuration.
        Returns:
        a new Cache.
        Throws:
        CacheException - error when creating the cache.
      • createNewLocalCache

        <T> Cache<T> createNewLocalCache​(CacheConfiguration config)
                                  throws CacheException
        Find the local cache implementation component to use and create a new cache.

        The new cache is based on a local storing implementation (to oppose to distributed cache) and is generally used for not big cache needing very quick access to datas.

        Type Parameters:
        T - the class of the data stored in the cache.
        Parameters:
        config - the cache configuration.
        Returns:
        a new local Cache.
        Throws:
        CacheException - error when creating the cache.