public class CacheManagerImpl extends CacheManager
Modifier and Type | Field and Description |
---|---|
static Cache2kCoreProvider |
PROVIDER |
Constructor and Description |
---|
CacheManagerImpl(Cache2kCoreProviderImpl _provider,
ClassLoader cl,
String _name,
boolean _default) |
Modifier and Type | Method and Description |
---|---|
void |
cacheDestroyed(Cache c)
Called from the cache during close()
|
static void |
checkName(String s)
Don't accept a cache or manager names with too weird characters.
|
void |
clear() |
void |
close()
The shutdown takes place in two phases.
|
<K,V> Cache<K,V> |
createCache(Cache2kConfiguration<K,V> cfg) |
Iterable<Cache> |
getActiveCaches() |
String |
getBuildNumber() |
<K,V> Cache<K,V> |
getCache(String name) |
static Iterable<CacheLifeCycleListener> |
getCacheLifeCycleListeners() |
ClassLoader |
getClassLoader() |
Object |
getLockObject()
Used for JSR107 cache manager implementation
|
String |
getName() |
Properties |
getProperties() |
Cache2kCoreProviderImpl |
getProvider() |
String |
getVersion() |
boolean |
isClosed() |
boolean |
isDefaultManager() |
String |
newCache(InternalCache c,
String _requestedName) |
void |
sendCreatedEvent(Cache c) |
String |
toString() |
close, closeAll, closeAll, getDefaultName, getInstance, getInstance, getInstance, getInstance, setDefaultName
public static final Cache2kCoreProvider PROVIDER
public CacheManagerImpl(Cache2kCoreProviderImpl _provider, ClassLoader cl, String _name, boolean _default)
public static Iterable<CacheLifeCycleListener> getCacheLifeCycleListeners()
public void sendCreatedEvent(Cache c)
public static void checkName(String s)
Cache2kBuilder.name(String)
public String newCache(InternalCache c, String _requestedName)
IllegalStateException
- if cache manager was closed or is closingIllegalStateException
- if cache already createdpublic void cacheDestroyed(Cache c)
public boolean isDefaultManager()
isDefaultManager
in class CacheManager
public String getName()
getName
in class CacheManager
public Iterable<Cache> getActiveCaches()
getActiveCaches
in class CacheManager
public <K,V> Cache<K,V> getCache(String name)
getCache
in class CacheManager
public <K,V> Cache<K,V> createCache(Cache2kConfiguration<K,V> cfg)
createCache
in class CacheManager
public void clear()
clear
in class CacheManager
public void close()
Rationale exception handling: Exceptions on shutdown just could silently ignored, because a shutdown is done any way. Exceptions could be happened long before in a parallel task, shutdown is the last point where this could be propagated to the application. Silently ignoring is bad anyway, because this will cause that serious problems keep undetected. The exception and error handling within the cache tries everything that exceptions will be routed through as early and directly as possible.
close
in interface Closeable
close
in interface AutoCloseable
close
in class CacheManager
public boolean isClosed()
isClosed
in class CacheManager
public Object getLockObject()
public Properties getProperties()
getProperties
in class CacheManager
public ClassLoader getClassLoader()
getClassLoader
in class CacheManager
public String getVersion()
public String getBuildNumber()
public Cache2kCoreProviderImpl getProvider()
cache2k API documentation. Copyright © 2000–2018 headissue GmbH, Munich.