Package com.yahoo.yolean.concurrent
Class Memoized<T,E extends Exception>
java.lang.Object
com.yahoo.yolean.concurrent.Memoized<T,E>
- All Implemented Interfaces:
AutoCloseable
,Supplier<T>
Wraps a lazily initialised resource which needs to be shut down.
The wrapped supplier may not return
null
, and should be retryable on failure.
If it throws, it will be retried if get()
is retried. A supplier that fails to
clean up partial state on failure may cause a resource leak.- Author:
- jonmv
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Memoized.Closer<T,
E extends Exception> Provides a tighter bound on the thrown exception type. -
Constructor Summary
-
Method Summary
-
Constructor Details
-
Memoized
-
-
Method Details