Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*
  * Copyright 2012-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
  *
  * Licensed under the Apache License, Version 2.0 (the "License").
  * You may not use this file except in compliance with the License.
  * A copy of the License is located at
  *
  *  http://aws.amazon.com/apache2.0
  *
 * or in the "license" file accompanying this file. This file is distributed
 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
 * express or implied. See the License for the specific language governing
 * permissions and limitations under the License.
 */
package com.amazonaws.services.simpleworkflow.flow;
Clock that must be used inside workflow definition code to ensure replay determinism.
public interface WorkflowClock {

    

Returns:
time of the com.amazonaws.services.simpleworkflow.model.DecisionTask start event of the decision being processed or replayed.
    public long currentTimeMillis();

    
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.
    public boolean isReplaying();

    
Create a Value that becomes ready after the specified delay.

Parameters:
delay time-interval after which the Value becomes ready in seconds.
Returns:
Promise that becomes ready after the specified delay.
    public abstract Promise<VoidcreateTimer(long delaySeconds);

    
Create a Value that becomes ready after the specified delay.

Parameters:
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.
    public abstract <T> Promise<T> createTimer(long delaySecondsfinal T context);
New to GrepCode? Check out our FAQ X