Interface AsyncCacheLoader.Context<K,​V>

  • All Superinterfaces:
    DataAware<K,​V>
    Enclosing interface:
    AsyncCacheLoader<K,​V>

    public static interface AsyncCacheLoader.Context<K,​V>
    extends DataAware<K,​V>
    Relevant context information for a single load request.

    Rationale: Instead of a rather long parameter list, we define an interface. This allows us later to add some information without breaking implementations of the AsyncCacheLoader. The context does not include the cache, since the loader should not depend on it and do any other operations on the cache while loading.

    • Method Detail

      • getCache

        Cache<K,​V> getCache()
        The cache originating the load request
      • getStartTime

        long getStartTime()
        Time in millis since epoch of start of load operation
      • getKey

        K getKey()
        Cache key for the load request. Although the key is a call parameter it is repeated here, so users can choose to pass on the key or the whole context.
      • isRefreshAhead

        boolean isRefreshAhead()
        Operation is refresh and not an immediate client request. This can be used to execute the operation at a lower priority. The CoalescingBulkLoader is using the flag to delay refresh requests and combine them into bulk requests.