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;
    private final AmazonSimpleWorkflow service;
    private final String taskToken;
    private final DataConverter dataConverter;
    public ManualActivityCompletionClientImpl(AmazonSimpleWorkflow serviceString taskTokenDataConverter dataConverter) {
        this. = service;
        this. = taskToken;
        this. = dataConverter;
    }
    @Override
    public void complete(Object result) {
        String convertedResult = .toData(result);
        request.setResult(convertedResult);
        request.setTaskToken();
        .respondActivityTaskCompleted(request);
    }
    @Override
    public void fail(Throwable failure) {
        String convertedFailure = .toData(failure);
        request.setReason(WorkflowExecutionUtils.truncateReason(failure.getMessage()));
        request.setDetails(convertedFailure);
        request.setTaskToken();
        .respondActivityTaskFailed(request);
    }
    @Override
    public void recordHeartbeat(String detailsthrows CancellationException {
        request.setDetails(details);
        request.setTaskToken();
        ActivityTaskStatus status = .recordActivityTaskHeartbeat(request);
        status = .recordActivityTaskHeartbeat(request);
        if (status.isCancelRequested()) {
            throw new CancellationException();
        }
    }
    @Override
    public void reportCancellation(String details) {
        request.setDetails(details);
        request.setTaskToken();
        .respondActivityTaskCanceled(request);
    }
New to GrepCode? Check out our FAQ X