Package javax.cache
Interface CacheManagerFactory
-
- All Known Implementing Classes:
CacheManagerFactoryImpl
public interface CacheManagerFactoryManages CacheManager instances. It is invoked by theCachingclass to create aCacheManager- Since:
- 1.0
- Author:
- Yannis Cosmadopoulos
-
-
Method Summary
All Methods Instance Methods Abstract 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 name)Get a named cache manager using the default cache loader as specified by the implementation.
-
-
-
Method Detail
-
getCacheManager
CacheManager getCacheManager(String name)
Get a named cache manager using the default cache loader as specified by the implementation.- Parameters:
name- the name of the cache manager- Returns:
- the named cache manager
- Throws:
NullPointerException- if name is null
-
getCacheManager
CacheManager getCacheManager(ClassLoader classLoader, String name)
Get the cache manager for the specified name and class loader. If there is no cache manager associated, it is created.- Parameters:
classLoader- associated with the cache manager.name- the name of the cache manager- Returns:
- the new cache manager
- Throws:
NullPointerException- if classLoader or name is null
-
close
void close() throws CachingShutdownExceptionReclaims 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.- Throws:
CachingShutdownException- if any of the individual shutdowns failed
-
close
boolean close(ClassLoader classLoader) throws CachingShutdownException
Reclaims all resources for a ClassLoader from this factory. All cache managers linked to the specified CacheLoader obtained from the factory are shutdown.- 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
boolean close(ClassLoader classLoader, String name) throws CachingShutdownException
Reclaims all resources for a ClassLoader from this factory. the named cache manager obtained from the factory is shutdown.- 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
-
-