Package de.hybris.platform.tx
Class InvalidationSet
java.lang.Object
de.hybris.platform.tx.InvalidationSet
- Direct Known Subclasses:
Transaction.TxInvalidationSet
Collects delayed invalidations and records simulated / derived invalidations too.
This class is intended to be used inside a running transaction and therefore should be used by one thread only!
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classInvalidation object representation.static classInvalidation processor based onInvalidationManager.static interfaceInterface for performing actual invalidation duringexecuteDelayedInvalidationsGlobally(),executeDelayedInvalidationsLocally()orexecuteDelayedRollbackInvalidationsLocally(). -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionaddInvalidation(Object[] key, int invalidationTopicDepth, int invalidationType) Registers a invalidation without dry-running it.static InvalidationSet.InvalidationcreateInvalidation(Object[] key, int invalidationTopicDepth, int invalidationType) Allows to create a standaloneInvalidationSet.Invalidationinstance.delayInvalidation(Object[] key, int invalidationTopicDepth, int invalidationType) Registers a new invalidation and dry-runs it using existing topics and listeners in order to record derived invalidations too.delayRollbackInvalidation(Object[] key, int invalidationTopicDepth, int invalidationType) Registers a invalidation for rollback.voidExecutes all recordedInvalidationSet.Invalidationobjects that have been registered viadelayRollbackInvalidation(Object[], int, int).voidExecutes all recordedInvalidationSet.Invalidationobjects that have been registered viadelayInvalidation(Object[], int, int).voidExecutes all recordedInvalidationSet.Invalidationobjects that have been registered viadelayRollbackInvalidation(Object[], int, int).protected InvalidationTargetstatic voidinvalidateGlobally(InvalidationSet.Invalidation invalidation) static voidinvalidateGlobally(Collection<InvalidationSet.Invalidation> invalidations) static voidinvalidateLocally(Collection<InvalidationSet.Invalidation> invalidations) booleanisEmpty()Tells whether this container has recorded any derived invalidation.booleanisInvalidated(Object[] key) Checks whether a specific key can be considered to be invalidated according to all recorded derived invalidations.protected void
-
Field Details
-
EMPTY_SET
Empty immutable invalidation set. Will throwUnsupportedOperationExceptionwhen calling any update method.
-
-
Constructor Details
-
InvalidationSet
public InvalidationSet() -
InvalidationSet
-
-
Method Details
-
createInvalidation
public static InvalidationSet.Invalidation createInvalidation(Object[] key, int invalidationTopicDepth, int invalidationType) Allows to create a standaloneInvalidationSet.Invalidationinstance. Use it to execute local or global invalidations viainvalidateGlobally(Collection)orinvalidateLocally(Collection). -
invalidateGlobally
-
invalidateGlobally
-
invalidateLocally
-
executeDelayedInvalidationsGlobally
public void executeDelayedInvalidationsGlobally()Executes all recordedInvalidationSet.Invalidationobjects that have been registered viadelayRollbackInvalidation(Object[], int, int).These will become effective globally which means that cache invalidation packets will be set to other cluster nodes as well!
-
getRealInvalidationTarget
-
executeDelayedInvalidationsLocally
public void executeDelayedInvalidationsLocally()Executes all recordedInvalidationSet.Invalidationobjects that have been registered viadelayInvalidation(Object[], int, int).They will become effective only locally which means that no cache invalidation packets will be set to other cluster nodes!
-
executeDelayedRollbackInvalidationsLocally
public void executeDelayedRollbackInvalidationsLocally()Executes all recordedInvalidationSet.Invalidationobjects that have been registered viadelayRollbackInvalidation(Object[], int, int).They will become effective only locally which means that no cache invalidation packets will be set to other cluster nodes!
-
delayInvalidation
public InvalidationSet.Invalidation delayInvalidation(Object[] key, int invalidationTopicDepth, int invalidationType) Registers a new invalidation and dry-runs it using existing topics and listeners in order to record derived invalidations too. As a resultisInvalidated(Object[])will respect not just this invalidation but also all derived ones.It does not invalidate the real cache here!
-
addInvalidation
public InvalidationSet.Invalidation addInvalidation(Object[] key, int invalidationTopicDepth, int invalidationType) Registers a invalidation without dry-running it. Therefore derived invalidations will not be recorded thus this has no effect onisInvalidated(Object[])! -
delayRollbackInvalidation
public InvalidationSet.Invalidation delayRollbackInvalidation(Object[] key, int invalidationTopicDepth, int invalidationType) Registers a invalidation for rollback. It will not be dry-run, which means that derived invalidations will not be recorded so this has no effect onisInvalidated(Object[])! -
singleKeyHasBeenInvalidated
-
isEmpty
public boolean isEmpty()Tells whether this container has recorded any derived invalidation. -
isInvalidated
Checks whether a specific key can be considered to be invalidated according to all recorded derived invalidations.
-