Class CachingRDFServiceExecutor<T>

  • Type Parameters:
    T -

    public class CachingRDFServiceExecutor<T>
    extends Object
    Utility class that populates and returns a cache. Once the cache is populated, it can return the cached results whilst refreshing in the background.
    • Method Detail

      • isCached

        public boolean isCached()
      • cachedWhen

        public Date cachedWhen()
      • get

        public T get​(edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService rdfService)
        Return the cached results if present, or start the task. Will wait for completion if the cache is not already populated, otherwise the refresh will happen in the background.
        Parameters:
        rdfService - an RDF service to use, in foreground mode, if the background service is missing
      • getNoWait

        public T getNoWait​(edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService rdfService)
        Return the cached results if present, or start the task. Will wait for completion if the cache is not already populated, otherwise the refresh will happen in the background.
        Parameters:
        rdfService - an RDF service to use, in foreground mode, if the background service is missing
      • get

        public T get​(edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService rdfService,
                     boolean allowWaits)
        Return the cached results if present, or start the task. Will wait for completion if the cache is not already populated, otherwise the refresh will happen in the background.
        Parameters:
        rdfService - an RDF service to use, in foreground mode, if the background service is missing
      • get

        public T get​(edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService rdfService,
                     boolean allowWaits,
                     boolean force)
      • build

        public void build​(edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService rdfService)
        (Re)build the current cache
        Parameters:
        rdfService - an RDF service to use, if the background RDF service is not set
      • setBackgroundRDFService

        public static void setBackgroundRDFService​(edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService rdfService)
        Set the RDF service to be used for background threads (called from a startup servlet)
        Parameters:
        rdfService - An RDFService