public abstract class CacheModule extends FactoryModule
Cache
instances in Guice.Modifier and Type | Field and Description |
---|---|
static String |
MEMORY_MODULE |
static String |
PERSISTENT_MODULE |
Constructor and Description |
---|
CacheModule() |
Modifier and Type | Method and Description |
---|---|
protected <K,V> CacheBinding<K,V> |
cache(String name,
Class<K> keyType,
Class<V> valType)
Declare a named in-memory cache.
|
protected <K,V> CacheBinding<K,V> |
cache(String name,
Class<K> keyType,
com.google.inject.TypeLiteral<V> valType)
Declare a named in-memory cache.
|
protected <K,V> CacheBinding<K,V> |
cache(String name,
com.google.inject.TypeLiteral<K> keyType,
com.google.inject.TypeLiteral<V> valType)
Declare a named in-memory cache.
|
protected <K,V> PersistentCacheBinding<K,V> |
persist(String name,
Class<K> keyType,
Class<V> valType)
Declare a named in-memory/on-disk cache.
|
protected <K,V> PersistentCacheBinding<K,V> |
persist(String name,
Class<K> keyType,
Class<V> valType,
CacheBackend backend)
Declare a named in-memory/on-disk cache.
|
protected <K,V> PersistentCacheBinding<K,V> |
persist(String name,
Class<K> keyType,
com.google.inject.TypeLiteral<V> valType)
Declare a named in-memory/on-disk cache.
|
protected <K,V> PersistentCacheBinding<K,V> |
persist(String name,
com.google.inject.TypeLiteral<K> keyType,
com.google.inject.TypeLiteral<V> valType,
CacheBackend backend)
Declare a named in-memory/on-disk cache.
|
factory
addError, addError, addError, bind, bind, bind, bindConstant, binder, bindInterceptor, bindListener, bindListener, bindScope, configure, configure, convertToTypes, currentStage, getMembersInjector, getMembersInjector, getProvider, getProvider, install, requestInjection, requestStaticInjection, requireBinding, requireBinding
public static final String MEMORY_MODULE
public static final String PERSISTENT_MODULE
protected <K,V> CacheBinding<K,V> cache(String name, Class<K> keyType, Class<V> valType)
K
- type of key used to lookup entries.V
- type of value stored by the cache.protected <K,V> CacheBinding<K,V> cache(String name, Class<K> keyType, com.google.inject.TypeLiteral<V> valType)
K
- type of key used to lookup entries.V
- type of value stored by the cache.protected <K,V> CacheBinding<K,V> cache(String name, com.google.inject.TypeLiteral<K> keyType, com.google.inject.TypeLiteral<V> valType)
K
- type of key used to lookup entries.V
- type of value stored by the cache.protected <K,V> PersistentCacheBinding<K,V> persist(String name, Class<K> keyType, Class<V> valType)
K
- type of key used to lookup entries.V
- type of value stored by the cache.protected <K,V> PersistentCacheBinding<K,V> persist(String name, Class<K> keyType, Class<V> valType, CacheBackend backend)
K
- type of key used to lookup entries.V
- type of value stored by the cache.backend
- cache backend.protected <K,V> PersistentCacheBinding<K,V> persist(String name, Class<K> keyType, com.google.inject.TypeLiteral<V> valType)
K
- type of key used to lookup entries.V
- type of value stored by the cache.protected <K,V> PersistentCacheBinding<K,V> persist(String name, com.google.inject.TypeLiteral<K> keyType, com.google.inject.TypeLiteral<V> valType, CacheBackend backend)
K
- type of key used to lookup entries.V
- type of value stored by the cache.