Coverage Report - org.webmacro.resource.CacheReloadContext
 
Classes in this File Line Coverage Branch Coverage Complexity
CacheReloadContext
50%
1/2
N/A
1
 
 1  
 /*
 2  
  * Copyright (C) 1998-2001 Semiotek Inc.  All Rights Reserved.
 3  
  *
 4  
  * Redistribution and use in source and binary forms, with or without
 5  
  * modification, are permitted under the terms of either of the following
 6  
  * Open Source licenses:
 7  
  *
 8  
  * The GNU General Public License, version 2, or any later version, as
 9  
  * published by the Free Software Foundation
 10  
  * (http://www.fsf.org/copyleft/gpl.html);
 11  
  *
 12  
  *  or
 13  
  *
 14  
  * The Semiotek Public License (http://webmacro.org/LICENSE.)
 15  
  *
 16  
  * This software is provided "as is", with NO WARRANTY, not even the
 17  
  * implied warranties of fitness to purpose, or merchantability. You
 18  
  * assume all risks and liabilities associated with its use.
 19  
  *
 20  
  * See www.webmacro.org for more information on the WebMacro project.
 21  
  */
 22  
 
 23  
 
 24  
 package org.webmacro.resource;
 25  
 
 26  
 
 27  
 /**
 28  
  * CacheReloadContext provides support for providers which support
 29  
  * cache invalidation on a per-element basis, for example if an underlying
 30  
  * resource has changed.  The reload context allows the cache manager to ask
 31  
  * the provider if the resource should be reloaded.
 32  
  * 
 33  
  * @since 0.96
 34  
  */
 35  
 
 36  57
 public abstract class CacheReloadContext
 37  
 {
 38  
 
 39  
     /**
 40  
      * The CacheManager calls <code>shouldReload()</code> to ask the reference 
 41  
      * whether it has changed since we loaded it.  Subclasses should define an
 42  
      * implementation of this if it makes sense to.  Otherwise, the default
 43  
      * returns false, which means the item is replaced when it expires from
 44  
      * the cache.
 45  
      */
 46  
     public boolean shouldReload ()
 47  
     {
 48  0
         return false;
 49  
     }
 50  
 }