1 /* 2 * Copyright (c) 2002-2003 by OpenSymphony 3 * All rights reserved. 4 */ 5 package com.opensymphony.oscache.base; 6 7 8 /** 9 * This exception is thrown when retrieving an item from cache and it is 10 * expired. 11 * Note that for fault tolerance purposes, it is possible to retrieve the 12 * current cached object from the exception. 13 * 14 * <p>January, 2004 - The OSCache developers are aware of the fact that throwing 15 * an exception for a perfect valid situation (cache miss) is design smell. This will 16 * be removed in the near future, and other means of refreshing the cache will be 17 * provided.</p> 18 * 19 * @author <a HREF="mailto:fbeauregard@pyxis-tech.com">Francois Beauregard</a> 20 * @version $Revision: 1.1 $ 21 */ 22 public final class NeedsRefreshException extends Exception { 23 /** 24 * Current object in the cache 25 */ 26 private Object cacheContent = null; 27 28 /** 29 * Create a NeedsRefreshException 30 */ 31 public NeedsRefreshException(Object cacheContent) { 32 super(); 33 this.cacheContent = cacheContent; 34 } 35 36 /** 37 * Retrieve current object in the cache 38 */ 39 public Object getCacheContent() { 40 return cacheContent; 41 } 42 } 43