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 void
complete(AsynchronousFlowCompletion completion)
Invoked by application code once theAsynchronousFlow
is complete.AsynchronousFlowCompletion
getCompletion()
Obtains the providedAsynchronousFlowCompletion
.boolean
isComplete()
Indicates ifAsynchronousFlow
is complete.AsynchronousFlowCompletion
waitOnCompletion()
Waits a default period of time for completion.AsynchronousFlowCompletion
waitOnCompletion(int timeToWait)
Waits for completion.
-
-
-
Method Detail
-
isComplete
public boolean isComplete()
Indicates ifAsynchronousFlow
is complete.- Returns:
true
ifAsynchronousFlow
is complete.
-
getCompletion
public AsynchronousFlowCompletion getCompletion()
Obtains the provided
AsynchronousFlowCompletion
.Note: will fail if this
AsynchronousFlow
is not complete.- Returns:
AsynchronousFlowCompletion
ornull
if 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:AsynchronousFlow
Invoked by application code once the
AsynchronousFlow
is complete.Note that only the first invocation of this method is considered. All further invocations are ignored.
Furthermore, if the
AsynchronousFlow
takes too long to complete then all invocations are ignored. TheManagedFunction
will be throwing anAsynchronousFlowTimedOutEscalation
.- Specified by:
complete
in interfaceAsynchronousFlow
- Parameters:
completion
-AsynchronousFlowCompletion
to updateManagedObject
state and possibly throw failures.
-
-