javax.cache
Interface CacheBuilder


public interface CacheBuilder

A CacheBuilder is used for creating Caches.

Since:
1.7
Author:
Yannis Cosmadopoulos

Method Summary
<K,V> Cache<K,V>
createCache(String cacheName)
          Create an instance of the named Cache.
<K,V> Cache<K,V>
createCache(String cacheName, CacheConfiguration configuration)
          Create an instance of the named Cache.
 

Method Detail

createCache

<K,V> Cache<K,V> createCache(String cacheName)
Create an instance of the named Cache. Solely responsible for creating uninitialized cache instances. Lookup and Lifecycle management are the responsibility of CacheManager. Implementations may use a default configuration or use the cache name to select a suitable configuration.

Type Parameters:
K - the key type
V - the value type
Parameters:
cacheName - the name of the cache
Returns:
a new instance of the named cache
Throws:
InvalidConfigurationException - thrown if the configuration is invalid
NullPointerException - is cacheName is null
See Also:
CacheManager

createCache

<K,V> Cache<K,V> createCache(String cacheName,
                             CacheConfiguration configuration)
Create an instance of the named Cache. Solely responsible for creating uninitialized cache instances. Lookup and Lifecycle management are the responsibility of CacheManager.

Type Parameters:
K - the key type
V - the value type
Parameters:
cacheName - the name of the cache
configuration - the configuration for the new cache
Returns:
a new instance of the named cache
Throws:
InvalidConfigurationException - thrown if the configuration is invalid
NullPointerException - is cacheName is null or configuration is null
See Also:
CacheManager


true