You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@turbine.apache.org by tv...@apache.org on 2007/09/10 19:07:52 UTC

svn commit: r574301 - in /turbine/fulcrum/trunk/cache: project.xml src/java/org/apache/fulcrum/cache/impl/JCSCacheService.java

Author: tv
Date: Mon Sep 10 10:07:51 2007
New Revision: 574301

URL: http://svn.apache.org/viewvc?rev=574301&view=rev
Log:
Update cache service to JCS 1.3, allow auxiliary caches to be shutdown properly.

Modified:
    turbine/fulcrum/trunk/cache/project.xml
    turbine/fulcrum/trunk/cache/src/java/org/apache/fulcrum/cache/impl/JCSCacheService.java

Modified: turbine/fulcrum/trunk/cache/project.xml
URL: http://svn.apache.org/viewvc/turbine/fulcrum/trunk/cache/project.xml?rev=574301&r1=574300&r2=574301&view=diff
==============================================================================
--- turbine/fulcrum/trunk/cache/project.xml (original)
+++ turbine/fulcrum/trunk/cache/project.xml Mon Sep 10 10:07:51 2007
@@ -49,11 +49,10 @@
       <version>1.0.4</version>
     </dependency>
 
-    <!--  For a more recent release of JCS and to make gump happy: -->
     <dependency>
       <groupId>concurrent</groupId>
       <artifactId>concurrent</artifactId>
-      <version>1.0</version>
+      <version>1.3.4</version>
       <type>jar</type>
     </dependency>
 
@@ -66,8 +65,7 @@
     <dependency>
       <groupId>jcs</groupId>
       <artifactId>jcs</artifactId>
-      <!-- version>1.2.7.9.2</version -->
-      <version>20030822.182132</version>
+      <version>1.3</version>
       <type>jar</type>
     </dependency>
 

Modified: turbine/fulcrum/trunk/cache/src/java/org/apache/fulcrum/cache/impl/JCSCacheService.java
URL: http://svn.apache.org/viewvc/turbine/fulcrum/trunk/cache/src/java/org/apache/fulcrum/cache/impl/JCSCacheService.java?rev=574301&r1=574300&r2=574301&view=diff
==============================================================================
--- turbine/fulcrum/trunk/cache/src/java/org/apache/fulcrum/cache/impl/JCSCacheService.java (original)
+++ turbine/fulcrum/trunk/cache/src/java/org/apache/fulcrum/cache/impl/JCSCacheService.java Mon Sep 10 10:07:51 2007
@@ -131,19 +131,12 @@
      */
     public void dispose()
     {
-        try
-        {
-            cacheManager.remove();
-        }
-        catch (CacheException e)
-        {
-            // do nothing
-        }
-
         continueThread = false;
         refreshing.interrupt();
 
+        cacheManager.dispose();
         cacheManager = null;
+        
         getLogger().debug("JCSCacheService stopped.");
     }
 
@@ -211,7 +204,7 @@
                 getLogger().warn("Object with id [" + id + "] is not serializable. Expect problems with auxiliary caches.");
             }
 
-            ElementAttributes attrib = (ElementAttributes)cacheManager.getElementAttributes();
+            ElementAttributes attrib = (ElementAttributes)cacheManager.getDefaultElementAttributes();
 
             if (o instanceof RefreshableCachedObject)
             {
@@ -224,9 +217,8 @@
             }
 
             attrib.setLastAccessTimeNow();
+            attrib.setCreateTime();
 
-            // I know this is not nice, but setCreateTime() is missing and the fields are public ...
-            attrib.createTime = System.currentTimeMillis();
             cacheManager.putInGroup(id, group, o, attrib);
         }
         catch (CacheException e)
@@ -295,7 +287,7 @@
             for (Iterator i = cacheManager.getGroupKeys(group).iterator(); i.hasNext();)
             {
                 String key= (String)i.next();
-                CachedObject o = (CachedObject)cacheManager.getFromGroup(key, group);
+                Object o = cacheManager.getFromGroup(key, group);
                 if (o == null)
                 {
                     removeObject(key);