@Service public class L2Cache extends DefaultMolgenisTransactionListener
| Constructor and Description |
|---|
L2Cache(TransactionManager transactionManager,
EntityHydration entityHydration,
TransactionInformation transactionInformation) |
| Modifier and Type | Method and Description |
|---|---|
void |
afterCommitTransaction(String transactionId) |
Entity |
get(Repository<Entity> repository,
Object id)
Retrieves an entity from the cache or the underlying repository.
|
List<Entity> |
getBatch(Repository<Entity> repository,
Iterable<Object> ids)
Retrieves a list of entities from the cache.
|
void |
logStatistics()
Logs cumulative cache statistics for all known caches.
|
commitTransaction, doCleanupAfterCompletion, rollbackTransaction, transactionStartedpublic L2Cache(TransactionManager transactionManager, EntityHydration entityHydration, TransactionInformation transactionInformation)
public void afterCommitTransaction(String transactionId)
afterCommitTransaction in interface TransactionListenerafterCommitTransaction in class DefaultMolgenisTransactionListenerpublic Entity get(Repository<Entity> repository, Object id)
repository - the underlying repositoryid - the ID of the entity to retrievecom.google.common.util.concurrent.UncheckedExecutionException - if the repository throws
an error when loading the entitypublic List<Entity> getBatch(Repository<Entity> repository, Iterable<Object> ids)
repository - the underlying repository, used to create the cache loader or to retrieve the
existing cacheids - Iterable of the ids of the entities to retrieveRuntimeException - if the cache failed to load the entities@Scheduled(fixedRate=60000L) public void logStatistics()
Copyright © 2018 Pivotal Software, Inc.. All rights reserved.