com.tangosol.net.events.partition.cache.EntryProcessorEvent Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of coherence Show documentation
Show all versions of coherence Show documentation
Oracle Coherence Community Edition
/*
* Copyright (c) 2000, 2020, Oracle and/or its affiliates.
*
* Licensed under the Universal Permissive License v 1.0 as shown at
* http://oss.oracle.com/licenses/upl.
*/
package com.tangosol.net.events.partition.cache;
import com.tangosol.util.BinaryEntry;
import com.tangosol.util.InvocableMap.EntryProcessor;
import java.util.Iterator;
import java.util.Set;
import java.util.function.Consumer;
/**
* An EntryProcessorEvent captures information relating to the execution of
* {@link EntryProcessor}s.
*
* @author bo, nsa, rhan, mwj 2011.03.29
* @since Coherence 12.1.2
*/
@SuppressWarnings("rawtypes")
public interface EntryProcessorEvent
extends Event, Iterable
{
/**
* Return a Set of {@link BinaryEntry entries} being processed by the
* entry processor.
*
* @return the Set of entries represented by this event
*/
public Set getEntrySet();
/**
* Return the {@link EntryProcessor} associated with this {@link
* EntryProcessorEvent}.
*
* @return the entry processor associated with this event
*/
public EntryProcessor getProcessor();
/**
* Returns an iterator over the {@link BinaryEntry entries} in this event.
*
* @return an iterator over the {@link BinaryEntry entries} in this event.
*/
@Override
public default Iterator iterator()
{
return getEntrySet().iterator();
}
// ----- constants ------------------------------------------------------
/**
* The {@link EntryProcessorEvent} types.
*/
public static enum Type
{
/**
* This {@link EntryProcessorEvent} is raised prior to executing an
* {@link EntryProcessor} on a set of entries.
*
* The following holds:
*
* - The {@link EntryProcessor} provided for this event type is
* mutable. The processor could be shared across threads, so
* processor implementations modified in this fashion must ensure
* thread-safety
* - A lock will be held for each Entry during the processing of
* this event preventing concurrent updates
* - Throwing an exception from this event will prevent the
* operation from being committed
*
*/
EXECUTING,
/**
* This {@link EntryProcessorEvent} is dispatched after an {@link
* EntryProcessor} has been executed.
*/
EXECUTED
}
}