[jboss-cvs] JBossCache/src/org/jboss/cache/eviction ...

Elias Ross genman at noderunner.net
Wed Feb 7 17:06:56 EST 2007


  User: genman  
  Date: 07/02/07 17:06:56

  Modified:    src/org/jboss/cache/eviction  ExpirationAlgorithm.java
  Log:
  JBCACHE-969 - Move transaction classes to org.jboss.cache.transaction
  
  Revision  Changes    Path
  1.9       +3 -20     JBossCache/src/org/jboss/cache/eviction/ExpirationAlgorithm.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: ExpirationAlgorithm.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/eviction/ExpirationAlgorithm.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -b -r1.8 -r1.9
  --- ExpirationAlgorithm.java	19 Jan 2007 02:04:19 -0000	1.8
  +++ ExpirationAlgorithm.java	7 Feb 2007 22:06:56 -0000	1.9
  @@ -3,7 +3,6 @@
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
   import org.jboss.cache.Fqn;
  -import org.jboss.cache.FqnComparator;
   import org.jboss.cache.NodeSPI;
   import org.jboss.cache.Region;
   
  @@ -18,14 +17,6 @@
    * same relative time as provided by {@link
    * java.lang.System#currentTimeMillis()}).
    * <p/>
  - * <!--
  - * Alternatively to setting the Node expiration key value, calling {@link
  - * Region#markNodeCurrentlyInUse} will cause the node to expire once the
  - * timeout is reached. Note that, because the expiration value is not stored on
  - * the node, the expiration time cannot be persisted or replicated.  Calling
  - * {@link Region#unmarkNodeCurrentlyInUse} unsets the expiration value.
  - * <p/>
  - * -->
    * This algorithm also obeys the configuration key {@link
    * ExpirationConfiguration#getMaxNodes()}, and will evict the soonest to
    * expire entires first to reduce the region size.  If there are not enough
  @@ -55,13 +46,6 @@
    * Thread.sleep(5000); // 5 seconds
    * assertTrue(cache.get(fqn1) == null);
    * <p/>
  - * <!--
  - * // Alternatively, this expires a node in one second
  - * cache.put(fqn1, "foo");
  - * cache.getRegion(fqn1, false).markNodeCurrentlyInUse(fqn1, 1000);
  - * Thread.sleep(2000); // 5 seconds
  - * assertTrue(cache.get(fqn1) == null);
  - * -->
    * </pre>
    */
   public class ExpirationAlgorithm extends BaseEvictionAlgorithm
  @@ -120,10 +104,9 @@
      private Long getExpiration(Fqn fqn)
      {
         NodeSPI n = policy.getCache().peek(fqn, false);
  -      Long l = (Long) (n == null ? null : n.getDirect(config.getExpirationKeyName()));
  -      if (l == null)
  +      if (n == null)
            return null;
  -      return l;
  +      return (Long)n.getDirect(config.getExpirationKeyName());
      }
   
      @Override
  @@ -258,7 +241,7 @@
               return -1;
            if (n > 0)
               return 1;
  -         return FqnComparator.INSTANCE.compare(fqn, ee.fqn);
  +         return fqn.compareTo(ee.fqn);
         }
   
         /**
  
  
  



More information about the jboss-cvs-commits mailing list