incubator-connectors-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1092805 - in /incubator/lcf/trunk: ./ framework/core/src/main/java/org/apache/manifoldcf/core/cachemanager/ framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/
Date Fri, 15 Apr 2011 20:45:15 GMT
Author: kwright
Date: Fri Apr 15 20:45:15 2011
New Revision: 1092805

URL: http://svn.apache.org/viewvc?rev=1092805&view=rev
Log:
Fix for CONNECTORS-181. Improve the way cache expiration works so that the model is more flexible.

Modified:
    incubator/lcf/trunk/CHANGES.txt
    incubator/lcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/cachemanager/BaseDescription.java
    incubator/lcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/cachemanager/CacheManager.java
    incubator/lcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/ICacheDescription.java

Modified: incubator/lcf/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/CHANGES.txt?rev=1092805&r1=1092804&r2=1092805&view=diff
==============================================================================
--- incubator/lcf/trunk/CHANGES.txt (original)
+++ incubator/lcf/trunk/CHANGES.txt Fri Apr 15 20:45:15 2011
@@ -3,6 +3,11 @@ $Id$
 
 ======================= 0.3-dev =========================
 
+CONNECTORS-181: Fix the way timed expiration works to agree with
+the description, and pass in a current time parameter to make it
+work readily for continuous renewal.
+(Karl Wright)
+
 CONNECTORS-179: Add ability to throw ManifoldCFException from the
 IConnector method setThreadContext.
 (Karl Wright)

Modified: incubator/lcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/cachemanager/BaseDescription.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/cachemanager/BaseDescription.java?rev=1092805&r1=1092804&r2=1092805&view=diff
==============================================================================
--- incubator/lcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/cachemanager/BaseDescription.java
(original)
+++ incubator/lcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/cachemanager/BaseDescription.java
Fri Apr 15 20:45:15 2011
@@ -56,7 +56,7 @@ public abstract class BaseDescription im
   * @return a time in milliseconds for the object to expire, or -1 if there is no expiration
   * desired.
   */
-  public long getObjectExpirationTime()
+  public long getObjectExpirationTime(long currentTime)
   {
     return -1;
   }

Modified: incubator/lcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/cachemanager/CacheManager.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/cachemanager/CacheManager.java?rev=1092805&r1=1092804&r2=1092805&view=diff
==============================================================================
--- incubator/lcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/cachemanager/CacheManager.java
(original)
+++ incubator/lcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/cachemanager/CacheManager.java
Fri Apr 15 20:45:15 2011
@@ -487,9 +487,7 @@ public class CacheManager implements ICa
   {
 
     // Update the expiration time for this object.
-    long expireInterval = objectDescription.getObjectExpirationTime();
-    if (expireInterval >= 0)
-      expireInterval += currentTime;
+    long expireInterval = objectDescription.getObjectExpirationTime(currentTime);
     cache.setObjectExpiration(objectDescription,expireInterval);
 
     // Update LRU and max counts.  This also flushes the cache to meet the criteria.

Modified: incubator/lcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/ICacheDescription.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/ICacheDescription.java?rev=1092805&r1=1092804&r2=1092805&view=diff
==============================================================================
--- incubator/lcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/ICacheDescription.java
(original)
+++ incubator/lcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/ICacheDescription.java
Fri Apr 15 20:45:15 2011
@@ -54,11 +54,12 @@ public interface ICacheDescription
   public ICacheClass getObjectClass();
 
   /** Obtain an expiration time for an object, in milliseconds since epoch.
-  * The cache manager will call this method for all objects that are being operated on,
-  * so that their expiration timestamps get properly updated to a new time.
+  * The cache manager will call this method whenever the object is being looked up,
+  * so that its expiration timestamps can be properly updated to a new time.
+  * @param currentTime is the time of the lookup, in milliseconds since epoch.
   * @return a time in milliseconds since epoch for the object to expire, or -1 if there is
no expiration
   * desired.
   */
-  public long getObjectExpirationTime();
+  public long getObjectExpirationTime(long currentTime);
 
 }



Mime
View raw message