public T get() {
        T object = this.object;
        if (object == null) {
            // If object is currently null then we will lock so that all threads requiring the object are blocked until
            // the first one creates it.
            synchronized (this) {
                object = this.object;
                if (object == null) {
                    object = update();
                    this.object = object;
                }
            }
        } else {
            // Check to see if the referenced object needs to be refreshed.
            final Instant lastRefresh = this.lastRefresh;
            if (lastRefresh == null || Instant.now().isAfter(lastRefresh.plus(updateInterval))) {
                updateAsync();
            }
        }

        return object;
    }
This class provides an object and updates the object asynchronously in the background periodically.
stroom-util/src/main/java/stroom/util/concurrent/AsyncReference.java