Class IdNameCache<T>

  • Type Parameters:
    T - the type of the key value held by the cache
    All Implemented Interfaces:
    IIdNameCache<T>

    public class IdNameCache<T>
    extends Object
    implements IIdNameCache<T>
    • Constructor Detail

      • IdNameCache

        public IdNameCache()
        Public constructor
    • Method Detail

      • updateSharedMaps

        public void updateSharedMaps()
        Description copied from interface: IIdNameCache
        Called after a transaction commit() to transfer all the staged (thread-local) data over to the shared cache.
        Specified by:
        updateSharedMaps in interface IIdNameCache<T>
      • reset

        public void reset()
        Description copied from interface: IIdNameCache
        Clear both local shared caches - useful for unit tests
        Specified by:
        reset in interface IIdNameCache<T>
      • clearLocalMaps

        public void clearLocalMaps()
        Description copied from interface: IIdNameCache
        Clear anything cached in thread-local (after transaction rollback, for example)
        Specified by:
        clearLocalMaps in interface IIdNameCache<T>
      • prefill

        public void prefill​(Map<T,​String> content)
        Description copied from interface: IIdNameCache
        Prefill the shared map with the given content (must come data already committed in the database)
        Specified by:
        prefill in interface IIdNameCache<T>