More tweaks to JMX exception handling

This commit is contained in:
Kris De Volder
2018-12-05 13:37:42 -08:00
parent 9bdb7f23bd
commit fb6f691908

View File

@@ -28,7 +28,7 @@ import reactor.core.Disposable;
* <p>
* Both real results and thrown exceptions are memoized.
*/
public class MemoizingDisposableSupplier<T> implements Supplier<T>, Disposable {
public class MemoizingDisposableSupplier<T> implements Disposable {
private static Logger logger = LoggerFactory.getLogger(MemoizingDisposableSupplier.class);
@@ -73,8 +73,7 @@ public class MemoizingDisposableSupplier<T> implements Supplier<T>, Disposable {
}
}
@Override
public synchronized T get() {
public synchronized T get() throws Exception {
Assert.isLegal(!isDisposed());
if (shouldCompute()) {
lastComputed = System.currentTimeMillis();
@@ -91,7 +90,7 @@ public class MemoizingDisposableSupplier<T> implements Supplier<T>, Disposable {
}
}
if (failure!=null) {
throw ExceptionUtil.unchecked(failure);
throw ExceptionUtil.exception(failure);
} else {
return value;
}