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 Constructor Description CacheManagerFactoryImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()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.CacheManagergetCacheManager(ClassLoader classLoader, String name)Get the cache manager for the specified name and class loader.CacheManagergetCacheManager(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.
-
-
-
Method Detail
-
getCacheManager
public CacheManager getCacheManager(String cacheManagerName)
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
public CacheManager getCacheManager(ClassLoader classLoader, String name)
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
public void close() throws CachingShutdownExceptionDescription 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
public boolean close(ClassLoader classLoader) throws CachingShutdownException
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
public boolean close(ClassLoader classLoader, String name) throws CachingShutdownException
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
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: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
-
-