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

org.infinispan.functional.impl.FunctionalNotifier Maven / Gradle / Ivy

There is a newer version: 9.1.7.Final
Show newest version
package org.infinispan.functional.impl;

import java.util.function.Supplier;

import org.infinispan.commons.api.functional.EntryView.ReadEntryView;
import org.infinispan.commons.api.functional.Listeners.ReadWriteListeners;
import org.infinispan.commons.util.Experimental;
import org.infinispan.factories.scopes.Scope;
import org.infinispan.factories.scopes.Scopes;

/**
 * Listener notifier.
 *
 * @since 8.0
 */
@Scope(Scopes.NAMED_CACHE)
@Experimental
public interface FunctionalNotifier extends ReadWriteListeners {

   /**
    * Notify registered {@link ReadWriteListener} instances of the created entry.
    */
   void notifyOnCreate(ReadEntryView created);

   /**
    * Notify registered {@link ReadWriteListener} instances of the modified
    * entry passing the previous and new value.
    */
   void notifyOnModify(ReadEntryView before, ReadEntryView after);

   /**
    * Notify registered {@link ReadWriteListener} instances of the removed
    * entry passing in the removed entry.
    */
   void notifyOnRemove(ReadEntryView removed);

   /**
    * Notify registered {@link WriteListener} instances of the written entry.
    *
    * @apiNote By using a {@link Supplier} the entry view can be computed lazily
    * only if any listeners has been registered.
    */
   void notifyOnWrite(Supplier> write);

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy