Class SingleEntryAsynchronousProcessor<K,​V,​R>

  • Type Parameters:
    K - the type of the Map entry key
    V - the type of the Map entry value
    R - the type of value returned by the EntryProcessor
    All Implemented Interfaces:
    FlowControl, InvocableMap.EntryProcessor<K,​V,​R>, Serializable, Future<R>

    public class SingleEntryAsynchronousProcessor<K,​V,​R>
    extends AbstractAsynchronousProcessor<K,​V,​R,​R>
    An EntryProcessor wrapper class that allows for an asynchronous invocation of the underlying processor against a single cache entry. When used as a Future (without extending), this implementation will collect the results of asynchronous invocation, providing the result semantics identical to the EntryProcessor.process contract.

    More advanced use would require extending this class and overriding onResult(java.util.Map.Entry<K, R>), onComplete(), and onException(java.lang.Throwable) methods.

    It's very important that the overriding implementations of these methods must be non-blocking. For example, any use of NamedCache API is completely disallowed, with the only exception of asynchronous agents with disabled flow control.

    The underlying entry processor is guaranteed to have been fully executed when onComplete() is called.

    Note 1: Neither this class nor its extensions need to be serializable. Only the underlying processor is serialized and sent to corresponding servers for execution.
    Note 2: This feature is not available on Coherence*Extend clients.

    Since:
    12.2.1
    Author:
    as 2015.01.26
    See Also:
    AsynchronousProcessor, Serialized Form
    • Field Detail

      • m_eReason

        protected volatile Throwable m_eReason
        Reason for the failed operation.
      • m_entry

        protected Map.Entry<K,​R> m_entry
        The result of entry processor invocation.
    • Constructor Detail

      • SingleEntryAsynchronousProcessor

        public SingleEntryAsynchronousProcessor​(InvocableMap.EntryProcessor<K,​V,​R> processor,
                                                Executor executor)
        Construct a SingleEntryAsynchronousProcessor for a given processor.
        Parameters:
        processor - the underlying InvocableMap.EntryProcessor
        executor - an optional Executor to complete the future on, if not provided the Daemons.commonPool() is used
      • SingleEntryAsynchronousProcessor

        public SingleEntryAsynchronousProcessor​(InvocableMap.EntryProcessor<K,​V,​R> processor,
                                                int iUnitOrderId)
        Construct a SingleEntryAsynchronousProcessor for a given processor.
        Parameters:
        processor - the underlying InvocableMap.EntryProcessor
        iUnitOrderId - the unit-of-order id for this processor
      • SingleEntryAsynchronousProcessor

        public SingleEntryAsynchronousProcessor​(InvocableMap.EntryProcessor<K,​V,​R> processor,
                                                int iUnitOrderId,
                                                Executor executor)
        Construct a SingleEntryAsynchronousProcessor for a given processor.
        Parameters:
        processor - the underlying InvocableMap.EntryProcessor
        iUnitOrderId - the unit-of-order id for this processor
        executor - an optional Executor to complete the future on, if not provided the Daemons.commonPool() is used