BATCH-1810: Documentation SimpleRetryPolicy code sample

This commit is contained in:
Chris Schaefer
2013-04-04 12:30:42 -04:00
committed by Michael Minella
parent 52b9692e74
commit 7a672267ef
2 changed files with 8 additions and 1 deletions

View File

@@ -42,6 +42,11 @@
<surname>Minella</surname>
</author>
<author>
<firstname>Chris</firstname>
<surname>Schaefer</surname>
</author>
</authorgroup>
<legalnotice>

View File

@@ -227,7 +227,9 @@ Foo result = template.execute(new RetryCallback&lt;Foo&gt;() {
this list overrides the retryable list so that it can be used to give
finer control over the retry behavior:</para>
<programlisting>SimpleRetryPolicy policy = new SimpleRetryPolicy(5);
<programlisting>SimpleRetryPolicy policy = new SimpleRetryPolicy();
// Set the max retry attempts
policy.setMaxAttempts(5);
// Retry on all exceptions (this is the default)
policy.setRetryableExceptions(new Class[] {Exception.class});
// ... but never retry IllegalStateException