Package com.google.gerrit.server.cache
Class CacheModule
- java.lang.Object
- 
- com.google.inject.AbstractModule
- 
- com.google.gerrit.extensions.config.FactoryModule
- 
- com.google.gerrit.server.cache.CacheModule
 
 
 
- 
- All Implemented Interfaces:
- com.google.inject.Module
 - Direct Known Subclasses:
- LdapModule,- SearchingChangeCacheImpl.Module
 
 public abstract class CacheModule extends FactoryModule Miniature DSL to support bindingCacheinstances in Guice.
- 
- 
Field SummaryFields Modifier and Type Field Description static StringMEMORY_MODULEstatic StringPERSISTENT_MODULE
 - 
Constructor SummaryConstructors Constructor Description CacheModule()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description 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>
 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, Class<K> keyType, Class<V> valType)Declare a named in-memory cache.protected <K extends Serializable,V extends Serializable>
 CacheBinding<K,V>persist(String name, com.google.inject.TypeLiteral<K> keyType, com.google.inject.TypeLiteral<V> valType)Declare a named in-memory/on-disk cache.protected <K extends Serializable,V extends Serializable>
 CacheBinding<K,V>persist(String name, Class<K> keyType, com.google.inject.TypeLiteral<V> valType)Declare a named in-memory/on-disk cache.protected <K extends Serializable,V extends Serializable>
 CacheBinding<K,V>persist(String name, Class<K> keyType, Class<V> valType)Declare a named in-memory/on-disk cache.- 
Methods inherited from class com.google.gerrit.extensions.config.FactoryModulefactory
 - 
Methods inherited from class com.google.inject.AbstractModuleaddError, addError, addError, bind, bind, bind, bindConstant, binder, bindInterceptor, bindListener, bindListener, bindScope, configure, configure, convertToTypes, currentStage, getMembersInjector, getMembersInjector, getProvider, getProvider, install, requestInjection, requestStaticInjection, requireBinding, requireBinding
 
- 
 
- 
- 
- 
Field Detail- 
MEMORY_MODULEpublic static final String MEMORY_MODULE - See Also:
- Constant Field Values
 
 - 
PERSISTENT_MODULEpublic static final String PERSISTENT_MODULE - See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
cacheprotected <K,V> CacheBinding<K,V> cache(String name, Class<K> keyType, Class<V> valType) Declare a named in-memory cache.- Type Parameters:
- K- type of key used to lookup entries.
- V- type of value stored by the cache.
- Returns:
- binding to describe the cache.
 
 - 
cacheprotected <K,V> CacheBinding<K,V> cache(String name, Class<K> keyType, com.google.inject.TypeLiteral<V> valType) Declare a named in-memory cache.- Type Parameters:
- K- type of key used to lookup entries.
- V- type of value stored by the cache.
- Returns:
- binding to describe the cache.
 
 - 
cacheprotected <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.- Type Parameters:
- K- type of key used to lookup entries.
- V- type of value stored by the cache.
- Returns:
- binding to describe the cache.
 
 - 
persistprotected <K extends Serializable,V extends Serializable> CacheBinding<K,V> persist(String name, Class<K> keyType, Class<V> valType) Declare a named in-memory/on-disk cache.- Type Parameters:
- K- type of key used to lookup entries.
- V- type of value stored by the cache.
- Returns:
- binding to describe the cache.
 
 - 
persistprotected <K extends Serializable,V extends Serializable> CacheBinding<K,V> persist(String name, Class<K> keyType, com.google.inject.TypeLiteral<V> valType) Declare a named in-memory/on-disk cache.- Type Parameters:
- K- type of key used to lookup entries.
- V- type of value stored by the cache.
- Returns:
- binding to describe the cache.
 
 - 
persistprotected <K extends Serializable,V extends Serializable> CacheBinding<K,V> persist(String name, com.google.inject.TypeLiteral<K> keyType, com.google.inject.TypeLiteral<V> valType) Declare a named in-memory/on-disk cache.- Type Parameters:
- K- type of key used to lookup entries.
- V- type of value stored by the cache.
- Returns:
- binding to describe the cache.
 
 
- 
 
-