Package org.wso2.carbon.caching.impl
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Reclaims all resources obtained from this factory.booleanclose(ClassLoader classLoader) Reclaims all resources for a ClassLoader from this factory.booleanclose(ClassLoader classLoader, String name) Reclaims all resources for a ClassLoader from this factory.getCacheManager(ClassLoader classLoader, String name) Get the cache manager for the specified name and class loader.getCacheManager(String cacheManagerName) Get a named cache manager using the default cache loader as specified by the implementation.voidremoveAllCacheManagers(String tenantDomain) Remove all the Caches and CacheManagers of the specified tenantvoidremoveCacheManager(CarbonCacheManager cacheManager, String tenantDomain) voidremoveCacheManagerMap(String tenantDomain) Remove cache manager stored for a tenant domain.
-
Constructor Details
-
CacheManagerFactoryImpl
public CacheManagerFactoryImpl()
-
-
Method Details
-
getCacheManager
Description copied from interface:CacheManagerFactoryGet a named cache manager using the default cache loader as specified by the implementation.- Specified by:
getCacheManagerin interfaceCacheManagerFactory- Parameters:
cacheManagerName- the name of the cache manager- Returns:
- the named cache manager
-
getCacheManager
Description copied from interface:CacheManagerFactoryGet the cache manager for the specified name and class loader. If there is no cache manager associated, it is created.- Specified by:
getCacheManagerin interfaceCacheManagerFactory- Parameters:
classLoader- associated with the cache manager.name- the name of the cache manager- Returns:
- the new cache manager
-
close
Description copied from interface:CacheManagerFactoryReclaims 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:
closein interfaceCacheManagerFactory- Throws:
CachingShutdownException- if any of the individual shutdowns failed
-
close
Description copied from interface:CacheManagerFactoryReclaims all resources for a ClassLoader from this factory. All cache managers linked to the specified CacheLoader obtained from the factory are shutdown.- Specified by:
closein interfaceCacheManagerFactory- 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
Description copied from interface:CacheManagerFactoryReclaims all resources for a ClassLoader from this factory. the named cache manager obtained from the factory is shutdown.- Specified by:
closein interfaceCacheManagerFactory- Parameters:
classLoader- the class loader for which managers will be shut downname- the name of the cache manager- Returns:
- true if found, false otherwise
- Throws:
CachingShutdownException- if there is a problem shutting down a CacheManager
-
removeCacheManager
-
removeAllCacheManagers
Remove all the Caches and CacheManagers of the specified tenant- Parameters:
tenantDomain- The domain of the tenant whose caches need to be removed
-
removeCacheManagerMap
Description copied from interface:TenantCacheManagerRemove cache manager stored for a tenant domain. This can be used for special requirements such as tenant deletion.- Specified by:
removeCacheManagerMapin interfaceTenantCacheManager- Parameters:
tenantDomain- tenant domain. Value should not be null
-