Class MockAsynchronousFlow
- java.lang.Object
-
- net.officefloor.compile.test.managedfunction.MockAsynchronousFlow
-
- All Implemented Interfaces:
AsynchronousFlow
public class MockAsynchronousFlow extends java.lang.Object implements AsynchronousFlow
MockAsynchronousFlow.- Author:
- Daniel Sagenschneider
-
-
Constructor Summary
Constructors Constructor Description MockAsynchronousFlow()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcomplete(AsynchronousFlowCompletion completion)Invoked by application code once theAsynchronousFlowis complete.AsynchronousFlowCompletiongetCompletion()Obtains the providedAsynchronousFlowCompletion.booleanisComplete()Indicates ifAsynchronousFlowis complete.AsynchronousFlowCompletionwaitOnCompletion()Waits a default period of time for completion.AsynchronousFlowCompletionwaitOnCompletion(int timeToWait)Waits for completion.
-
-
-
Method Detail
-
isComplete
public boolean isComplete()
Indicates ifAsynchronousFlowis complete.- Returns:
trueifAsynchronousFlowis complete.
-
getCompletion
public AsynchronousFlowCompletion getCompletion()
Obtains the provided
AsynchronousFlowCompletion.Note: will fail if this
AsynchronousFlowis not complete.- Returns:
AsynchronousFlowCompletionornullif not provided.
-
waitOnCompletion
public AsynchronousFlowCompletion waitOnCompletion(int timeToWait)
Waits for completion.- Parameters:
timeToWait- Time in milliseconds to wait.- Returns:
- Provided
AsynchronousFlowCompletion.
-
waitOnCompletion
public AsynchronousFlowCompletion waitOnCompletion()
Waits a default period of time for completion.- Returns:
- Provided
AsynchronousFlowCompletion.
-
complete
public void complete(AsynchronousFlowCompletion completion)
Description copied from interface:AsynchronousFlowInvoked by application code once the
AsynchronousFlowis complete.Note that only the first invocation of this method is considered. All further invocations are ignored.
Furthermore, if the
AsynchronousFlowtakes too long to complete then all invocations are ignored. TheManagedFunctionwill be throwing anAsynchronousFlowTimedOutEscalation.- Specified by:
completein interfaceAsynchronousFlow- Parameters:
completion-AsynchronousFlowCompletionto updateManagedObjectstate and possibly throw failures.
-
-