Class CacheManagerFactoryImpl

java.lang.Object
org.wso2.carbon.caching.impl.CacheManagerFactoryImpl
All Implemented Interfaces:
CacheManagerFactory, TenantCacheManager

public class CacheManagerFactoryImpl extends Object implements CacheManagerFactory, TenantCacheManager
Carbon implementation of java cache.
  • Constructor Details

    • CacheManagerFactoryImpl

      public CacheManagerFactoryImpl()
  • Method Details

    • getCacheManager

      public CacheManager getCacheManager(String cacheManagerName)
      Description copied from interface: CacheManagerFactory
      Get a named cache manager using the default cache loader as specified by the implementation.
      Specified by:
      getCacheManager in interface CacheManagerFactory
      Parameters:
      cacheManagerName - the name of the cache manager
      Returns:
      the named cache manager
    • getCacheManager

      public CacheManager getCacheManager(ClassLoader classLoader, String name)
      Description copied from interface: CacheManagerFactory
      Get the cache manager for the specified name and class loader.

      If there is no cache manager associated, it is created.

      Specified by:
      getCacheManager in interface CacheManagerFactory
      Parameters:
      classLoader - associated with the cache manager.
      name - the name of the cache manager
      Returns:
      the new cache manager
    • close

      public void close() throws CachingShutdownException
      Description copied from interface: CacheManagerFactory
      Reclaims all resources obtained from this factory.

      All cache managers obtained from the factory are shutdown.

      Subsequent requests from this factory will return different cache managers than would have been obtained before shutdown.

      Specified by:
      close in interface CacheManagerFactory
      Throws:
      CachingShutdownException - if any of the individual shutdowns failed
    • close

      public boolean close(ClassLoader classLoader) throws CachingShutdownException
      Description copied from interface: CacheManagerFactory
      Reclaims all resources for a ClassLoader from this factory.

      All cache managers linked to the specified CacheLoader obtained from the factory are shutdown.

      Specified by:
      close in interface CacheManagerFactory
      Parameters:
      classLoader - the class loader for which managers will be shut down
      Returns:
      true if found, false otherwise
      Throws:
      CachingShutdownException - if any of the individual shutdowns failed
    • close

      public boolean close(ClassLoader classLoader, String name) throws CachingShutdownException
      Description copied from interface: CacheManagerFactory
      Reclaims all resources for a ClassLoader from this factory.

      the named cache manager obtained from the factory is shutdown.

      Specified by:
      close in interface CacheManagerFactory
      Parameters:
      classLoader - the class loader for which managers will be shut down
      name - the name of the cache manager
      Returns:
      true if found, false otherwise
      Throws:
      CachingShutdownException - if there is a problem shutting down a CacheManager
    • removeCacheManager

      public void removeCacheManager(CarbonCacheManager cacheManager, String tenantDomain)
    • removeAllCacheManagers

      public void removeAllCacheManagers(String tenantDomain)
      Remove all the Caches and CacheManagers of the specified tenant
      Parameters:
      tenantDomain - The domain of the tenant whose caches need to be removed
    • removeCacheManagerMap

      public void removeCacheManagerMap(String tenantDomain)
      Description copied from interface: TenantCacheManager
      Remove cache manager stored for a tenant domain. This can be used for special requirements such as tenant deletion.
      Specified by:
      removeCacheManagerMap in interface TenantCacheManager
      Parameters:
      tenantDomain - tenant domain. Value should not be null