|
Oracle® Fusion Middleware Java API Reference for Oracle Coherence 12c (12.1.3.0.0) E47890-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
com.tangosol.util.AsynchronousAgent
com.tangosol.util.aggregator.AsynchronousAggregator
public class AsynchronousAggregator
A marker EntryAggregator
wrapper class that allows for an asynchronous invocation of the underlying aggregator. When used as a Future
(without extending), this implementation will simply provide the result
of asynchronous parallel aggregation according to semantics of the corresponding EntryAggregator.aggregate
contract.
More advanced use would require extending this class and overriding onResult(java.lang.Object)
and onException(java.lang.Throwable)
methods. It's very important that overriding implementations of these methods must be non-blocking. For example, any use of NamedCache
API is completely disallowed with the only exception of AsynchronousAggregators
and AsynchronousProcessors
with disabled flow control.
The underlying entry processor is guaranteed to have been fully executed when either onResult()
or onException()
are called.
Note 1: Neither this class nor its extensions need to be serializable. Only the underlying aggregator is serialized and sent to corresponding servers for execution.
Note 2: This feature is not available on Coherence*Extend clients.
AsynchronousProcessor
Field Summary |
---|
Fields inherited from class com.tangosol.util.AsynchronousAgent |
---|
m_control, m_eReason, m_fFlowControl, m_iOrderId, m_oResult |
Constructor Summary | |
---|---|
AsynchronousAggregator(InvocableMap.ParallelAwareAggregator aggregator) Construct an AsynchronousAggregator for a given parallel aggregator and the automatic flow control "on". |
|
AsynchronousAggregator(InvocableMap.ParallelAwareAggregator aggregator, boolean fFlowControl) Construct an AsynchronousAggregator for a given parallel aggregator. |
|
AsynchronousAggregator(InvocableMap.ParallelAwareAggregator aggregator, boolean fFlowControl, int iUnitOrderId) Construct an AsynchronousAggregator for a given parallel aggregator. |
Method Summary | |
---|---|
java.lang.Object |
aggregate(java.util.Set setEntries) Not supported. |
InvocableMap.ParallelAwareAggregator |
getAggregator() Return the underlying parallel aggregator. |
int |
getUnitOfOrderId() Return a unit-of-order id associated with this aggregator. |
void |
onException(java.lang.Throwable eReason) Called if the operation failed for any reason. |
void |
onResult(java.lang.Object oResult) Called when the aggregation result is available. |
Methods inherited from class com.tangosol.util.AsynchronousAgent |
---|
bind, cancel, checkBacklog, drainBacklog, flush, get, get, isAutoFlowControl, isCancelled, isDone, setException, setResult, toString |
Constructor Detail |
---|
public AsynchronousAggregator(InvocableMap.ParallelAwareAggregator aggregator)
aggregator
- the underlying parallel aggregatorpublic AsynchronousAggregator(InvocableMap.ParallelAwareAggregator aggregator, boolean fFlowControl)
aggregator
- the underlying parallel aggregatorfFlowControl
- if true, the calling thread could be held by the service flow control logic (based on the destination backlog); otherwise it's the caller's responsibility to modulate the request flow (e.g. ensure that the invocation rate does not outpace the response rate)public AsynchronousAggregator(InvocableMap.ParallelAwareAggregator aggregator, boolean fFlowControl, int iUnitOrderId)
aggregator
- the underlying parallel aggregatorfFlowControl
- if true, the calling thread could be held by the service flow control logic (based on the destination backlog); otherwise it's the caller's responsibility to modulate the request flow (e.g. ensure that the invocation rate does not outpace the response rate)iUnitOrderId
- the unit-of-order id for this aggregatorMethod Detail |
---|
public void onResult(java.lang.Object oResult)
For ordering guarantees see getUnitOfOrderId()
.
Note: Overriding implementations of this method must be non-blocking.
oResult
- the resultpublic void onException(java.lang.Throwable eReason)
Note: Overriding implementations of this method must be non-blocking.
eReason
- the reason of failurepublic int getUnitOfOrderId()
If two consecutive "aggregate" calls made using AsynchronousAggregators
with the same order id and involve the same key set, then the corresponding execution
and calls to onResult(java.lang.Object)
are going to happen in the exact same order.
Note 1: the ordering guarantee is respected between AsynchronousAggregator
s and AsynchronousProcessor
s with the same unit-of-order id;
Note 2: there is no ordering guarantee between asynchronous and synchronous operations.
public InvocableMap.ParallelAwareAggregator getAggregator()
public java.lang.Object aggregate(java.util.Set setEntries)
aggregate
in interface InvocableMap.EntryAggregator
setEntries
- a Set of read-only InvocableMap.Entry objects to aggregate
|
Oracle® Fusion Middleware Java API Reference for Oracle Coherence 12c (12.1.3.0.0) E47890-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |