Anonymous avatar Anonymous committed 9d191da

[CACHE-56] - a refreshPeriod is no longer required

Comments (0)

Files changed (1)

src/core/java/com/opensymphony/oscache/base/Cache.java

      * Retrieve an object from the cache specifying its key.
      *
      * @param key             Key of the object in the cache.
+     *
+     * @return The object from cache
+     *
+     * @throws NeedsRefreshException Thrown when the object either
+     * doesn't exist, or exists but is stale. When this exception occurs,
+     * the CacheEntry corresponding to the supplied key will be locked
+     * and other threads requesting this entry will potentially be blocked
+     * until the caller repopulates the cache. If the caller choses not
+     * to repopulate the cache, they <em>must</em> instead call
+     * {@link #cancelUpdate(String)}.
+     */
+    public Object getFromCache(String key) throws NeedsRefreshException {
+        return getFromCache(key, CacheEntry.INDEFINITE_EXPIRY, null);
+    }
+
+    /**
+     * Retrieve an object from the cache specifying its key.
+     *
+     * @param key             Key of the object in the cache.
      * @param refreshPeriod   How long before the object needs refresh. To
      * allow the object to stay in the cache indefinitely, supply a value
      * of {@link CacheEntry#INDEFINITE_EXPIRY}.
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.