Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2012 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.annotations;
 
 
This annotation can be used for retrying failures on any asynchronous executions.

For retrying based on dynamic retry policy use com.amazonaws.services.simpleworkflow.flow.interceptors.RetryDecorator. Both

Author(s):
fateev, samar
ExponentialRetry:
annotation and com.amazonaws.services.simpleworkflow.flow.interceptors.RetryDecorator should not be used simultaneously on the same asynchronous method call.

To allow retries for an individual activity, place the annotation on the desired activity method in the corresponding @Activities interface. Since a new activity instance is started per retry, any timeouts configured on the

ActivityRegistrationOptions:
apply to each individual retry of the activity.

To allow retries for an entire workflow, place the annotation on the override of the workflow's @Execute method in the @Workflow's implementation (rather than on the interface). Since the same workflow instance is reused for each retry, any timeouts configured on the @WorkflowRegistrationOptions apply to the total time of the workflow over all retries.

 
 public @interface ExponentialRetry {

    
Interval to wait after the initial failure, before triggering a retry.

This value should not be greater than values specified for maximumRetryPeriod or retryExpirationPeriod.

 
     long initialRetryIntervalSeconds();

    
Maximum interval to wait between retry attempts.

This value should not be less than value specified for initialRetryPeriod. Default value is unlimited.

 
Total duration across all attempts before giving up and attempting no further retries.

This duration is measured relative to the initial attempt's starting time. and

This value should not be less than value specified for initialRetryPeriod. Default value is unlimited.

 
Coefficient to use for exponential retry policy.

The retry interval will be multiplied by this coefficient after each subsequent failure. Default is 2.0.

 
Number of maximum retry attempts (including the initial attempt). Default value is no limit.
 
Default is Throwable which means that all exceptions are retried.
 
     Class<? extends Throwable>[] exceptionsToRetry() default { Throwable.class };

    
What exceptions that match exceptionsToRetry list should be not retried. Default is empty list.
    Class<? extends Throwable>[] excludeExceptions() default {};
New to GrepCode? Check out our FAQ X