@Component public class L1Cache extends DefaultMolgenisTransactionListener
| Constructor and Description |
|---|
L1Cache(MolgenisTransactionManager molgenisTransactionManager,
EntityHydration entityHydration) |
| Modifier and Type | Method and Description |
|---|---|
void |
doCleanupAfterCompletion(String transactionId) |
void |
evict(java.util.stream.Stream<EntityKey> entityKeys) |
void |
evictAll(EntityType entityType) |
Optional<Entity> |
get(String entityName,
Object id,
EntityType entityType)
Retrieves an entity from the L1 cache based on a combination of entity name and entity id.
|
void |
put(String entityName,
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, rollbackTransaction@Autowired public L1Cache(MolgenisTransactionManager molgenisTransactionManager, EntityHydration entityHydration)
public void transactionStarted(String transactionId)
transactionStarted in interface MolgenisTransactionListenertransactionStarted in class DefaultMolgenisTransactionListenerpublic void doCleanupAfterCompletion(String transactionId)
doCleanupAfterCompletion in interface MolgenisTransactionListenerdoCleanupAfterCompletion in class DefaultMolgenisTransactionListenerpublic void putDeletion(EntityKey entityKey)
public void evictAll(EntityType entityType)
public void evict(java.util.stream.Stream<EntityKey> entityKeys)
public Optional<Entity> get(String entityName, Object id, EntityType entityType)
entityName - 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 © 2017. All Rights Reserved.