Package org.infinispan.commons.api
Interface BasicCacheContainer
-
- All Superinterfaces:
Lifecycle
- All Known Subinterfaces:
CacheContainer
,EmbeddedCacheManager
,RemoteCacheContainer
- All Known Implementing Classes:
DefaultCacheManager
,RemoteCacheManager
public interface BasicCacheContainer extends Lifecycle
BasicCacheContainer defines the methods used to obtain aBasicCache
.- Since:
- 4.0
- Author:
- Manik Surtani (manik@jboss.org), Galder Zamarreño, Mircea.Markus@jboss.com
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <K,V>
BasicCache<K,V>getCache()
Retrieves the default cache associated with this cache container.<K,V>
BasicCache<K,V>getCache(String cacheName)
Retrieves a cache by name.Set<String>
getCacheNames()
This method returns a collection of all cache names.
-
-
-
Method Detail
-
getCache
<K,V> BasicCache<K,V> getCache()
Retrieves the default cache associated with this cache container.- Returns:
- the default cache.
- Throws:
CacheConfigurationException
- if a default cache does not exist.
-
getCache
<K,V> BasicCache<K,V> getCache(String cacheName)
Retrieves a cache by name.If the cache has been previously created with the same name, the running cache instance is returned. Otherwise, this method attempts to create the cache first.
- Parameters:
cacheName
- name of cache to retrieve- Returns:
- a cache instance identified by cacheName
-
getCacheNames
Set<String> getCacheNames()
This method returns a collection of all cache names.The configurations may have been defined via XML, in the programmatic configuration, or at runtime.
Internal-only caches are not included.
- Returns:
- an immutable set of cache names registered in this cache manager.
-
-