[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jboss-cvs-commits
Subject:    [jboss-cvs] JBossCache/src/org/jboss/cache/eviction   ...
From:       genman () noderunner ! net (Elias Ross)
Date:       2007-01-24 11:48:54
Message-ID: E1H4R3H-0005ky-89 () committer01 ! frg ! pub ! inap ! atl ! jboss ! com
[Download RAW message or body]

  User: genman  
  Date: 07/01/09 19:10:47

  Modified:    src/org/jboss/cache/eviction   ExpirationConfiguration.java
                        ExpirationAlgorithm.java
  Log:
  JBCACHE-880 - Add documention/examples for this policy
  
  Revision  Changes    Path
  1.4       +3 -3      JBossCache/src/org/jboss/cache/eviction/ExpirationConfiguration.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: ExpirationConfiguration.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/eviction/ExpirationConfiguration.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -b -r1.3 -r1.4
  --- ExpirationConfiguration.java	11 Dec 2006 21:14:34 -0000	1.3
  +++ ExpirationConfiguration.java	10 Jan 2007 00:10:47 -0000	1.4
  @@ -13,13 +13,13 @@
      /**
       * Default key name for indicating expiration time. 
       */
  -   public static final String DEFAULT_EXPIRATION_KEY = "expiration";
  +   public static final String EXPIRATION_KEY = "expiration";
   
      /**
       * Node key name used to indicate the expiration of a node. 
       */
      @Dynamic
  -   private String expirationKeyName = DEFAULT_EXPIRATION_KEY;
  +   private String expirationKeyName = EXPIRATION_KEY;
      
      @Dynamic
      private boolean warnNoExpirationKey = true;
  
  
  
  1.6       +8 -2      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.5
  retrieving revision 1.6
  diff -u -b -r1.5 -r1.6
  --- ExpirationAlgorithm.java	1 Jan 2007 22:12:19 -0000	1.5
  +++ ExpirationAlgorithm.java	10 Jan 2007 00:10:47 -0000	1.6
  @@ -17,12 +17,14 @@
    * 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
  @@ -44,19 +46,21 @@
    * <pre>
    * Cache cache;
    * Fqn fqn1 = Fqn.fromString("/node/1");
  - * Long future = Long.valueOf(System.currentTimeMillis() + 2000);
  - * cache.put(fqn1, ExpirationConfiguration.DEFAULT_EXPIRATION_KEY, future);
  + * Long future = new Long(System.currentTimeMillis() + 2000);
  + * cache.put(fqn1, ExpirationConfiguration.EXPIRATION_KEY, future);
    * cache.put(fqn1, "foo");
    * assertTrue(cache.get(fqn1) != null);
    * <p/>
    * 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
  @@ -273,6 +277,8 @@
   
         public boolean equals(Object o)
         {
  +         if (!(o instanceof ExpirationEntry))
  +            return false;
            ExpirationEntry ee = (ExpirationEntry) o;
            return fqn.equals(ee.fqn);
         }
  
  
  

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic