Commits

Anonymous committed 34ccf02

Improved JavaDocs - explains usage of CacheEntry.INDEFINITE_EXPIRY

  • Participants
  • Parent commits 46b3237

Comments (0)

Files changed (2)

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.
-     * @param refreshPeriod   How long before the object needs refresh
+     * @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}.
      *
      * @return The object from cache
      *
      * 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
+     * @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}.
      * @param cronExpiry      A cron expression that specifies fixed date(s)
      *                        and/or time(s) that this cache entry should
      *                        expire on.

src/core/java/com/opensymphony/oscache/general/GeneralCacheAdministrator.java

  */
 package com.opensymphony.oscache.general;
 
-import com.opensymphony.oscache.base.AbstractCacheAdministrator;
-import com.opensymphony.oscache.base.Cache;
-import com.opensymphony.oscache.base.EntryRefreshPolicy;
-import com.opensymphony.oscache.base.NeedsRefreshException;
+import com.opensymphony.oscache.base.*;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
      * Get an object from the cache
      *
      * @param key             The key entered by the user.
-     * @param refreshPeriod   How long the object can stay in cache in seconds.
+     * @param refreshPeriod   How long the object can stay in cache in seconds. To
+     * allow the entry to stay in the cache indefinitely, supply a value of
+     * {@link CacheEntry#INDEFINITE_EXPIRY}
      * @return   The object from cache
      * @throws NeedsRefreshException when no cache entry could be found with the
      * supplied key, or when an entry was found but is considered out of date. If
      * Get an object from the cache
      *
      * @param key             The key entered by the user.
-     * @param refreshPeriod   How long the object can stay in cache in seconds.
+     * @param refreshPeriod   How long the object can stay in cache in seconds. To
+     * allow the entry to stay in the cache indefinitely, supply a value of
+     * {@link CacheEntry#INDEFINITE_EXPIRY}
      * @param cronExpression  A cron expression that the age of the cache entry
      * will be compared to. If the entry is older than the most recent match for the
      * cron expression, the entry will be considered stale.