Interface CacheFlusher

  • All Superinterfaces:
    AutoCloseable

    public interface CacheFlusher
    extends AutoCloseable
    Exposes the flush() 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 with addLoaded(SimpleEntity)
    • Method Detail

      • addLoaded

        void addLoaded​(SimpleEntity entity)
        Notifies about an entity that has been loaded while this CacheFlusher was active. Any loaded entities will be detached on close().
      • flush

        boolean flush()
        Flushes the underlying EntityManager, but only after a given number of invocations. Returns whether the EntityManager has been actually flushed (true) or just incremented an internal counter (false)
      • wrap

        <T> DataIterator<T> wrap​(com.mysema.commons.lang.CloseableIterator<T> iterator)
        Wraps an Iterator, calling flush() on every Iterator.next(), and, if the given iterator is a CloseableIterator, closing when the iterator is closed.