Did this page help you?

   Yes   No   Tell us about it...

com.amazonaws.services.simpleworkflow.flow.test
Class TestWorkflowClock

java.lang.Object
  extended by com.amazonaws.services.simpleworkflow.flow.test.TestWorkflowClock
All Implemented Interfaces:
WorkflowClock

public class TestWorkflowClock
extends Object
implements WorkflowClock


Constructor Summary
TestWorkflowClock()
           
 
Method Summary
 void advanceMilliseconds(long milliseconds)
           
 void advanceSeconds(long seconds)
           
 Promise<Void> createTimer(long delaySeconds)
          Create a Value that becomes ready after the specified delay.
<T> Promise<T>
createTimer(long delaySeconds, T context)
          Create a Value that becomes ready after the specified delay.
 long currentTimeMillis()
           
 Long fireTimers()
           
 boolean isReplaying()
          true indicates if workflow is replaying already processed events to reconstruct it state.
 void setCurrentTimeMillis(long timeMillis)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestWorkflowClock

public TestWorkflowClock()
Method Detail

currentTimeMillis

public long currentTimeMillis()
Specified by:
currentTimeMillis in interface WorkflowClock
Returns:
time of the DecisionTask start event of the decision being processed or replayed.

setCurrentTimeMillis

public void setCurrentTimeMillis(long timeMillis)

isReplaying

public boolean isReplaying()
Description copied from interface: WorkflowClock
true indicates if workflow is replaying already processed events to reconstruct it state. false indicates that code is making forward process for the first time. For example can be used to avoid duplicating log records due to replay.

Specified by:
isReplaying in interface WorkflowClock

createTimer

public Promise<Void> createTimer(long delaySeconds)
Description copied from interface: WorkflowClock
Create a Value that becomes ready after the specified delay.

Specified by:
createTimer in interface WorkflowClock
Returns:
Promise that becomes ready after the specified delay.

createTimer

public <T> Promise<T> createTimer(long delaySeconds,
                                  T context)
Description copied from interface: WorkflowClock
Create a Value that becomes ready after the specified delay.

Specified by:
createTimer in interface WorkflowClock
context - context object that is returned inside the value when it becomes ready.
Returns:
Promise that becomes ready after the specified delay. When ready it contains value passed as context parameter.

fireTimers

public Long fireTimers()

advanceSeconds

public void advanceSeconds(long seconds)

advanceMilliseconds

public void advanceMilliseconds(long milliseconds)


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