T - The type of instances to handle.public class XRecent<T,X extends Exception> extends Object implements XSupplier<T,X>
Problem to solve:
There are objects that, due to their technical properties, are predestined to be initialized and made available once throughout the application. In particular, they are state-free but relatively "expensive" to initialize. Due to their semantics, however, they have to be renewed from time to time. An example of such an object could be an authentication token.
This class serves to handle such objects and in particular their updating.
public XRecent(XSupplier<? extends T,? extends X> newSubject, long maxIdle, long maxLiving)
XSupplier for the type to be handled and
an intended lifetime of such instances.
CAUTION: The given lifetime should be significantly smaller than the actually expected life span of an instance to be handled, otherwise there may not be enough time to use a provided instance successfully!
newSubject - the XSupplier for the instances to handlemaxIdle - the maximum idle time in millisecondsmaxLiving - the maximum lifetime in millisecondsCopyright © 2023 Andreas Kluge-Kaindl, Bremen (de). All rights reserved.