|
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
public abstract class AsynchronousAgent
Base class for asynchronous operations that provides a simple implementation of the Future interface. It is assumed that subclasses at some point will provide either the result of successful execution or a failure reason.
| Field Summary | |
|---|---|
protected FlowControl |
m_controlThe underlying FlowControl; could be null if the "automatic flow control" is turned on. |
protected java.lang.Throwable |
m_eReasonA reason of operation failure. |
protected boolean |
m_fFlowControlSpecifies whether or not the caller is a subject of the automatic flow control, e.g. the calling thread could be held by the service flow control logic. |
protected int |
m_iOrderIdA unit-of-order id associated with this agent. |
protected java.lang.Object |
m_oResultA result of operation (if successful). |
| Constructor Summary | |
|---|---|
protected |
AsynchronousAgent(boolean fFlowControl, int iOrderId)Construct the agent. |
| Method Summary | |
|---|---|
void |
bind(FlowControl control)Bind this agent with the specified underlying FlowControl object. |
boolean |
cancel(boolean mayInterruptIfRunning) |
boolean |
checkBacklog(com.oracle.common.base.Continuation continueNormal)Check for an excessive backlog and if the underlying communication channel is indeed clogged, call the specified continuation when the backlog is back to normal or the service terminates. |
long |
drainBacklog(long cMillis)Check for an excessive backlog and allow blocking the calling thread for up to the specified amount of time. |
void |
flush()Ensure that any buffered asynchronous operations are dispatched to the underlying tier. |
java.lang.Object |
get() |
java.lang.Object |
get(long cTimeout, java.util.concurrent.TimeUnit unit) |
boolean |
isAutoFlowControl()Specifies whether or not the caller is a subject of the automatic flow control, e.g. the calling thread could be held by the service flow control logic. |
boolean |
isCancelled() |
boolean |
isDone() |
protected void |
setException(java.lang.Throwable eReason)Should be called if the operation failed for any reason. |
protected void |
setResult(java.lang.Object oResult)Should be called if the operation completed successfully. |
java.lang.String |
toString() |
| Field Detail |
|---|
protected FlowControl m_control
protected final boolean m_fFlowControl
protected final int m_iOrderId
protected java.lang.Object m_oResult
protected java.lang.Throwable m_eReason
| Constructor Detail |
|---|
protected AsynchronousAgent(boolean fFlowControl,
int iOrderId)
fFlowControl - pass true if the calling thread could be held by the service flow control logic; otherwise it's the callers responsibility to modulate the flow (e.g. ensure that the invocation rate does not outpace the response rate)iOrderId - a unit-of-order id associated with this agent. Ordering semantics of operations based on this id are defined by subclasses| Method Detail |
|---|
public boolean cancel(boolean mayInterruptIfRunning)
cancel in interface java.util.concurrent.Futurepublic boolean isCancelled()
isCancelled in interface java.util.concurrent.Futurepublic boolean isDone()
isDone in interface java.util.concurrent.Future
public java.lang.Object get()
throws java.lang.InterruptedException,
java.util.concurrent.ExecutionException
get in interface java.util.concurrent.Futurejava.lang.InterruptedExceptionjava.util.concurrent.ExecutionException
public java.lang.Object get(long cTimeout,
java.util.concurrent.TimeUnit unit)
throws java.lang.InterruptedException,
java.util.concurrent.ExecutionException,
java.util.concurrent.TimeoutException
get in interface java.util.concurrent.Futurejava.lang.InterruptedExceptionjava.util.concurrent.ExecutionExceptionjava.util.concurrent.TimeoutExceptionpublic void bind(FlowControl control)
control - the underlying FlowControlpublic void flush()
FlowControlNote: this is a non-blocking call.
flush in interface FlowControlpublic long drainBacklog(long cMillis)
FlowControldrainBacklog in interface FlowControlcMillis - the maximum amount of time to wait (in milliseconds), or zero for infinite waitpublic boolean checkBacklog(com.oracle.common.base.Continuation continueNormal)
FlowControltrue.checkBacklog in interface FlowControlcontinueNormal - (optional) Continuation to be called when the backlog has been reduced back to normalprotected void setResult(java.lang.Object oResult)
oResult - the result of the asynchronous executionprotected void setException(java.lang.Throwable eReason)
eReason - the reason of failurepublic boolean isAutoFlowControl()
public java.lang.String toString()
|
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 | |||||||