Class RetryableDeclarativeAgent<A extends RetryableDeclarativeAgent<A>>

All Implemented Interfaces:
ExtensionPoint, Describable<A>, Serializable

public abstract class RetryableDeclarativeAgent<A extends RetryableDeclarativeAgent<A>> extends DeclarativeAgent<A>
A type of agent option that supports automatic retries. Usage from your DeclarativeAgentScript.run(groovy.lang.Closure) would look something like:

 Closure run = {
     script.node {
         CheckoutScript.doCheckout(script, describable, null, body).call()
     }
 }
 if (describable.retries > 1) {
     return {
         script.retry(count: describable.retries, conditions: [script.agent(), script.nonresumable()]) {
             run.call()
         }
     }
 } else {
     run
 }
See Also:
  • Constructor Details

    • RetryableDeclarativeAgent

      public RetryableDeclarativeAgent()
  • Method Details

    • getRetries

      public int getRetries()
    • setRetries

      @DataBoundSetter public void setRetries(int retries)