Package aQute.lib.memoize
Class RefreshingMemoizingSupplier<T>
java.lang.Object
aQute.lib.memoize.RefreshingMemoizingSupplier<T>
The object can exist in one of two states:
- expired which means that System.nanoTime is greater than timebound. memoized may hold an expired value or null. The object transitions to this state when time_to_live elapses. This is the initial state. From this state, the object transitions to valued when @{code get} is called.
- valued which means that System.nanoTime is less than timebound. memoized holds the current value.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionRefreshingMemoizingSupplier
(Supplier<? extends T> supplier, long time_to_live, TimeUnit unit) -
Method Summary
-
Field Details
-
supplier
-
time_to_live
private final long time_to_live -
timebound
private volatile long timebound -
memoized
-
-
Constructor Details
-
RefreshingMemoizingSupplier
-
-
Method Details