Did this page help you?

   Yes   No   Tell us about it...

com.amazonaws.services.simpleworkflow.flow.core
Class AsyncScope

java.lang.Object
  extended by com.amazonaws.services.simpleworkflow.flow.core.AsyncScope
All Implemented Interfaces:
Cancelable

public abstract class AsyncScope
extends Object
implements Cancelable

Interface between synchronous and asynchronous code. Serves as a root scope for asynchronous computation and as event loop for the owning synchronous code.


Constructor Summary
AsyncScope()
           
AsyncScope(boolean disableAsyncStackTrace, boolean excludeAsyncScopeStack)
           
 
Method Summary
 void cancel(Throwable cause)
           
 boolean eventLoop()
          Execute all queued tasks.
 List<AsyncTaskInfo> getAsynchronousThreadDump()
           
 String getAsynchronousThreadDumpAsString()
           
 Throwable getFailure()
           
 boolean isCancelRequested()
           
 boolean isComplete()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AsyncScope

public AsyncScope()

AsyncScope

public AsyncScope(boolean disableAsyncStackTrace,
                  boolean excludeAsyncScopeStack)
Method Detail

cancel

public void cancel(Throwable cause)
Specified by:
cancel in interface Cancelable

isCancelRequested

public boolean isCancelRequested()
Specified by:
isCancelRequested in interface Cancelable

getAsynchronousThreadDump

public List<AsyncTaskInfo> getAsynchronousThreadDump()

getAsynchronousThreadDumpAsString

public String getAsynchronousThreadDumpAsString()

eventLoop

public boolean eventLoop()
                  throws Throwable
Execute all queued tasks. If execution of those tasks result in addition of new tasks to the queue execute them as well.

Unless there are external dependencies or bugs single call to this method performs the complete asynchronous execution.

In presence of external dependencies it is expected that eventLoop() is called every time after change in their state can unblock the asynchronous execution.

Returns:
true means there are no tasks originated from this scope that are not done yet.
Throws:
Throwable

isComplete

public boolean isComplete()

getFailure

public Throwable getFailure()


Copyright © 2010 Amazon Web Services, Inc. All Rights Reserved.