Class InvalidationSet

  • Direct Known Subclasses:
    Transaction.TxInvalidationSet

    @NotThreadSafe
    public class InvalidationSet
    extends java.lang.Object
    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!

    • Field Detail

      • EMPTY_SET

        public static InvalidationSet EMPTY_SET
        Empty immutable invalidation set. Will throw UnsupportedOperationException when calling any update method.
    • Method Detail

      • executeDelayedInvalidationsLocally

        public void executeDelayedInvalidationsLocally()
        Executes all recorded InvalidationSet.Invalidation objects that have been registered via delayInvalidation(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​(java.lang.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 result isInvalidated(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​(java.lang.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 on isInvalidated(Object[])!
      • delayRollbackInvalidation

        public InvalidationSet.Invalidation delayRollbackInvalidation​(java.lang.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 on isInvalidated(Object[])!
      • singleKeyHasBeenInvalidated

        protected void singleKeyHasBeenInvalidated​(java.lang.Object[] key)
      • isEmpty

        public boolean isEmpty()
        Tells whether this container has recorded any derived invalidation.
      • isInvalidated

        public boolean isInvalidated​(java.lang.Object[] key)
        Checks whether a specific key can be considered to be invalidated according to all recorded derived invalidations.