Class CoexpressionCacheImpl
- java.lang.Object
-
- ubic.gemma.persistence.service.association.coexpression.CoexpressionCacheImpl
-
- All Implemented Interfaces:
InitializingBean
,CoexpressionCache
@Component public class CoexpressionCacheImpl extends Object implements InitializingBean, CoexpressionCache
Configures the cache for gene2gene coexpression.- Author:
- paul
-
-
Field Summary
-
Fields inherited from interface ubic.gemma.persistence.service.association.coexpression.CoexpressionCache
CACHE_QUERY_STRINGENCY
-
-
Constructor Summary
Constructors Constructor Description CoexpressionCacheImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterPropertiesSet()
Initialize the cache; if it already exists it will not be recreated.void
cacheCoexpression(Long geneId, Collection<CoexpressionValueObject> r)
void
cacheCoexpression(Map<Long,List<CoexpressionValueObject>> r)
void
clearCache()
Remove all elements from the cache.List<CoexpressionValueObject>
get(Long geneId)
boolean
isEnabled()
boolean
remove(Long id)
int
remove(Collection<Long> genes)
Bulk remove from cache.void
shutdown()
-
-
-
Method Detail
-
afterPropertiesSet
public void afterPropertiesSet()
Initialize the cache; if it already exists it will not be recreated.- Specified by:
afterPropertiesSet
in interfaceInitializingBean
-
cacheCoexpression
public void cacheCoexpression(Long geneId, Collection<CoexpressionValueObject> r)
- Specified by:
cacheCoexpression
in interfaceCoexpressionCache
-
cacheCoexpression
public void cacheCoexpression(Map<Long,List<CoexpressionValueObject>> r)
- Specified by:
cacheCoexpression
in interfaceCoexpressionCache
-
clearCache
public void clearCache()
Description copied from interface:CoexpressionCache
Remove all elements from the cache.- Specified by:
clearCache
in interfaceCoexpressionCache
-
get
public List<CoexpressionValueObject> get(Long geneId)
- Specified by:
get
in interfaceCoexpressionCache
- Parameters:
geneId
- gene id- Returns:
- results sorted in descending order of support, or null if the gene was not in the cache
-
isEnabled
public boolean isEnabled()
- Specified by:
isEnabled
in interfaceCoexpressionCache
-
remove
public int remove(Collection<Long> genes)
Description copied from interface:CoexpressionCache
Bulk remove from cache.- Specified by:
remove
in interfaceCoexpressionCache
- Parameters:
genes
- genes- Returns:
- number of cache entries affected
-
remove
public boolean remove(Long id)
- Specified by:
remove
in interfaceCoexpressionCache
-
shutdown
public void shutdown()
- Specified by:
shutdown
in interfaceCoexpressionCache
-
-