Class JaloItemCacheUnit

java.lang.Object
de.hybris.platform.cache.AbstractCacheUnit
de.hybris.platform.jalo.JaloItemCacheUnit
All Implemented Interfaces:
CacheValueLoader
Direct Known Subclasses:
WrapperFactory.PrecomputedJaloItemCacheUnit

public abstract class JaloItemCacheUnit extends AbstractCacheUnit
Cache unit holding one jalo item object. This unit is invalidated upon item removal only!
  • Field Details

    • NOT_IN_CACHE

      static final de.hybris.platform.jalo.Item.StillInCacheCallback NOT_IN_CACHE
  • Constructor Details

    • JaloItemCacheUnit

      protected JaloItemCacheUnit(Cache cache, PK pk)
  • Method Details

    • getPk

      public PK getPk()
    • createKey

      public Object[] createKey()
      Specified by:
      createKey in class AbstractCacheUnit
    • compute

      public abstract Object compute()
      Specified by:
      compute in class AbstractCacheUnit
    • invalidate

      public void invalidate(int invalidationType)
      Description copied from class: AbstractCacheUnit
      mark the Cache Unit to be invalidated upon commit invalidationType is one of the constants (modified or remove)
      Overrides:
      invalidate in class AbstractCacheUnit
    • setCacheBoundFalse

      public void setCacheBoundFalse()
    • removedFromCache

      public void removedFromCache()
      Overrides:
      removedFromCache in class AbstractCacheUnit
    • addedToCacheBeforeComputation

      public void addedToCacheBeforeComputation()
      Overrides:
      addedToCacheBeforeComputation in class AbstractCacheUnit
    • getCached

      public Object getCached()
      get the cached object from this cache unit. if it is not yet computed, this method blocks until it's computed.

      helper method which does exactly the same as AbstractCacheUnit.get(), but catches the exception and throws a RuntimeException (JaloSystemException) instead. because of that you don't have to add a try/catch block in your code.

      Returns:
      the object
    • isStillInCache

      public boolean isStillInCache()