All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.infinispan.api.common.events.cache.CacheEntryEvent Maven / Gradle / Ivy

package org.infinispan.api.common.events.cache;

import org.infinispan.api.common.CacheEntry;

/**
 * @since 14.0
 **/
public interface CacheEntryEvent {
   /**
    * @return The entry after the event
    */
   CacheEntry newEntry();

   /**
    * @return The entry before the event
    */
   CacheEntry previousEntry();

   /**
    * @return True if this event is generated from an existing entry as the listener has {@link
    * CacheListenerOptions#includeCurrentState()} set to true.
    */
   default boolean isCurrentState() {
      return false;
   }

   /**
    * @return an identifier of the transaction or cache invocation that triggered the event. In a transactional cache,
    * it is the transaction object associated with the current call. In a non-transactional cache, it is an internal
    * object that identifies the cache invocation.
    */
   default Object getSource() {
      return null;
   }

   /**
    * @return true if the call originated on the local cache instance; false if originated from a remote one.
    */
   default boolean isOriginLocal() {
      return false;
   }

   CacheEntryEventType type();
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy