@Component public class L1Cache extends DefaultMolgenisTransactionListener
| Constructor and Description |
|---|
L1Cache(TransactionManager transactionManager,
EntityHydration entityHydration) |
| Modifier and Type | Method and Description |
|---|---|
void |
doCleanupAfterCompletion(String transactionId) |
void |
evict(Stream<EntityKey> entityKeys) |
void |
evictAll(EntityType entityType) |
Optional<Entity> |
get(String entityTypeId,
Object id,
EntityType entityType)
Retrieves an entity from the L1 cache based on a combination of entity name and entity id.
|
void |
put(String entityTypeId,
Entity entity)
Puts an entity into the L1 cache, if the cache exists for the current thread.
|
void |
putDeletion(EntityKey entityKey) |
void |
transactionStarted(String transactionId) |
afterCommitTransaction, commitTransaction, rollbackTransactionpublic L1Cache(TransactionManager transactionManager, EntityHydration entityHydration)
public void transactionStarted(String transactionId)
transactionStarted in interface TransactionListenertransactionStarted in class DefaultMolgenisTransactionListenerpublic void doCleanupAfterCompletion(String transactionId)
doCleanupAfterCompletion in interface TransactionListenerdoCleanupAfterCompletion in class DefaultMolgenisTransactionListenerpublic void putDeletion(EntityKey entityKey)
public void evictAll(EntityType entityType)
public Optional<Entity> get(String entityTypeId, Object id, EntityType entityType)
entityTypeId - name of the entity to retrieveid - id value of the entity to retrieveEntity or Optional.empty() if deletion of this entity is stored in the cache or
null if no information available about this entity in the cacheCopyright © 2018 Pivotal Software, Inc.. All rights reserved.