Package de.hybris.platform.jalo
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!
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Item.StillInCacheCallback.NotInTheCache
-
Field Summary
Fields Modifier and Type Field Description static de.hybris.platform.jalo.Item.StillInCacheCallback
NOT_IN_CACHE
-
Fields inherited from class de.hybris.platform.cache.AbstractCacheUnit
cacheKey, INVALIDATIONTYPE_CREATED, INVALIDATIONTYPE_MODIFIED, INVALIDATIONTYPE_MODIFIED_STRING, INVALIDATIONTYPE_REMOVED, INVALIDATIONTYPE_REMOVED_STRING, UNKNOWN
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
JaloItemCacheUnit(Cache cache, PK pk)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addedToCacheBeforeComputation()
abstract java.lang.Object
compute()
java.lang.Object[]
createKey()
java.lang.Object
getCached()
get the cached object from this cache unit.PK
getPk()
void
invalidate(int invalidationType)
mark the Cache Unit to be invalidated upon commit invalidationType is one of the constants (modified or remove)boolean
isStillInCache()
void
removedFromCache()
void
setCacheBoundFalse()
-
Methods inherited from class de.hybris.platform.cache.AbstractCacheUnit
equals, executeInvalidation, get, getCache, getInvalidationTopicDepth, getKey, getKeyAsArray, getLoader, getTenantID, getWithoutCompute, getWithoutComputeIgnoringTransaction, hashCode, hintValue, isCachingSupported, isValueKnown, load, toString, useCache
-
-
-
-
Method Detail
-
getPk
public PK getPk()
-
createKey
public java.lang.Object[] createKey()
- Specified by:
createKey
in classAbstractCacheUnit
-
compute
public abstract java.lang.Object compute()
- Specified by:
compute
in classAbstractCacheUnit
-
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 classAbstractCacheUnit
-
setCacheBoundFalse
public void setCacheBoundFalse()
-
removedFromCache
public void removedFromCache()
- Overrides:
removedFromCache
in classAbstractCacheUnit
-
addedToCacheBeforeComputation
public void addedToCacheBeforeComputation()
- Overrides:
addedToCacheBeforeComputation
in classAbstractCacheUnit
-
getCached
public java.lang.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()
-
-