Commit Graph

5 Commits

Author SHA1 Message Date
Josh Long
004d277c81 javadoc 2016-02-12 17:12:40 +01:00
Dave Syer
c1ad693825 Tidy up some javadocs 2016-02-10 09:34:21 +00:00
Dave Syer
5fc484df58 Parameterize exception type in RetryCallback
So RetryCallback<T, E extends Throwable> and the E parameter appears
in RetryOperations too, making it possible to call it with an unchecked
exception type in the parameter and not catch exceptions.

Users should beware: it's just syntactic sugar, and the actual runtime
type of the exception is never checked at runtime. So, for instance,
declaring a RetryCallback<Object,IllegalArgumentException> doesn't
mean that other Exceptions won't be retried, just that you won't be
able to explicitly throw them if they are checked.

A project using Spring Batch 2.2 was used to test that this works
with user code that uses a library compiled agains Spring Retry 1.0.

Fixes gh-6
2014-04-24 12:18:32 +01:00
Dave Syer
dab8602a0e Change method signatures to Throwable (from Exception)
This allows use of spring-retry with naughty libraries that use Error
conditions to signal retryable exceptions. Users can still declare their
RetryCallback as "throws Exception" if they want to be conservative.

Also added throwLastExceptionOnExhausted to RetryTemplate to throw
the last exception instead of the ExhaustedRetryException.
2014-04-22 16:55:14 +01:00
Dave Syer
9dd0346f31 Add test cases and re-org packages 2010-12-21 17:57:32 +00:00