Package mondrian.util
Class ExpiringReference<T>
- java.lang.Object
-
- java.lang.ref.Reference<T>
-
- java.lang.ref.SoftReference<T>
-
- mondrian.util.ExpiringReference<T>
-
public class ExpiringReference<T> extends SoftReference<T>
An expiring reference is a subclass ofSoftReference
which pins the reference in memory until a certain timeout is reached. After that, the reference is free to be garbage collected if needed.The timeout value must be provided as a String representing both the time value and the time unit. For example, 1 second is represented as "1s". Valid time units are [d, h, m, s, ms], representing respectively days, hours, minutes, seconds and milliseconds.
-
-
Constructor Summary
Constructors Constructor Description ExpiringReference(T ref, String timeout)
Creates an expiring reference.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T
get()
T
get(String timeout)
-
Methods inherited from class java.lang.ref.Reference
clear, clone, enqueue, isEnqueued, reachabilityFence
-
-