Class LoomCacheEntryEvent<K,V>

java.lang.Object
java.util.EventObject
javax.cache.event.CacheEntryEvent<K,V>
com.loomcache.server.jcache.LoomCacheEntryEvent<K,V>
Type Parameters:
K - the key type
V - the value type
All Implemented Interfaces:
Serializable, javax.cache.Cache.Entry<K,V>

public final class LoomCacheEntryEvent<K,V> extends javax.cache.event.CacheEntryEvent<K,V>
Represents a cache entry lifecycle event.

Fired when cache entries are created, updated, removed, or expired. Extends CacheEntryEvent so listeners registered via both the native CacheEntryListener and JSR-107 listener types receive identical event objects.

See Also:
  • Constructor Details

    • LoomCacheEntryEvent

      public LoomCacheEntryEvent(K key, @Nullable V oldValue, @Nullable V newValue, LoomCacheEntryEvent.EventType eventType, @Nullable Object source)
      Construct a cache entry event.

      Accepts null source for backwards compatibility. JSR-107's parent constructor requires a Cache source, so when the caller passes null or a non-Cache we substitute a no-op placeholder. Original source is preserved via source().

  • Method Details

    • key

      public K key()
    • oldValue

      public @Nullable V oldValue()
    • newValue

      public @Nullable V newValue()
    • eventType

      public LoomCacheEntryEvent.EventType eventType()
    • source

      public @Nullable Object source()
    • timestamp

      public long timestamp()
    • getKey

      public K getKey()
    • getValue

      public @Nullable V getValue()
      Specified by:
      getValue in interface javax.cache.Cache.Entry<K,V>
      Specified by:
      getValue in class javax.cache.event.CacheEntryEvent<K,V>
    • getOldValue

      public @Nullable V getOldValue()
      Specified by:
      getOldValue in class javax.cache.event.CacheEntryEvent<K,V>
    • isOldValueAvailable

      public boolean isOldValueAvailable()
      Specified by:
      isOldValueAvailable in class javax.cache.event.CacheEntryEvent<K,V>
    • unwrap

      public <T> T unwrap(Class<T> clazz)
    • isSourceCache

      public boolean isSourceCache()
    • equals

      public boolean equals(@Nullable Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class EventObject