Re-apply changes

This commit is contained in:
rick.parker
2016-05-24 09:41:00 +01:00
parent 1e9f97f890
commit f8e610aa71
7 changed files with 645 additions and 1 deletions

View File

@ -146,6 +146,14 @@ class ThreadBox<T>(content: T, val lock: Lock = ReentrantLock()) {
inline fun <R> locked(body: T.() -> R): R = lock.withLock { body(content) }
}
/**
* This represents a transient exception or condition that might no longer be thrown if the operation is re-run or called
* again.
*
* We avoid the use of the word transient here to hopefully reduce confusion with the term in relation to (Java) serialization.
*/
abstract class RetryableException(message: String) : Exception(message)
/**
* A simple wrapper that enables the use of Kotlin's "val x by TransientProperty { ... }" syntax. Such a property
* will not be serialized to disk, and if it's missing (or the first time it's accessed), the initializer will be