Interface CacheFlusher
-
- All Superinterfaces:
AutoCloseable
public interface CacheFlusher extends AutoCloseable
Exposes theflush()method, which keeps an internal counter and only actually flushes every few times. After a flush is performed, it detaches all entities which were registered withaddLoaded(SimpleEntity)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddLoaded(SimpleEntity entity)Notifies about an entity that has been loaded while thisCacheFlusherwas active.voidclose()Closes thisCacheFlusher, detaching all entitiesbooleanflush()Flushes the underlyingEntityManager, but only after a given number of invocations.
-
-
-
Method Detail
-
addLoaded
void addLoaded(SimpleEntity entity)
Notifies about an entity that has been loaded while thisCacheFlusherwas active. Any loaded entities will be detached onclose().
-
close
void close()
Closes thisCacheFlusher, detaching all entities- Specified by:
closein interfaceAutoCloseable
-
flush
boolean flush()
Flushes the underlyingEntityManager, but only after a given number of invocations. Returns whether theEntityManagerhas been actually flushed (true) or just incremented an internal counter (false)
-
-