Class SingleEntryAsynchronousProcessor<K,V,R>

java.lang.Object
com.tangosol.util.AsynchronousAgent<R>
com.tangosol.util.processor.AbstractAsynchronousProcessor<K,V,R,R>
com.tangosol.util.processor.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:
  • Field Details

    • 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 Details

    • SingleEntryAsynchronousProcessor

      public SingleEntryAsynchronousProcessor(InvocableMap.EntryProcessor<K,V,R> processor)
      Construct a SingleEntryAsynchronousProcessor for a given processor.
      Parameters:
      processor - the underlying InvocableMap.EntryProcessor
    • 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
  • Method Details