View Javadoc
1 /* Reattore HTTP Server 2 3 Copyright (C) 2002 Michael Hope <michaelh@juju.net.nz> 4 5 This program is free software; you can redistribute it and/or modify 6 it under the terms of the GNU General Public License as published by 7 the Free Software Foundation; either version 2 of the License, or 8 (at your option) any later version. 9 10 This program is distributed in the hope that it will be useful, 11 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 GNU General Public License for more details. 14 15 You should have received a copy of the GNU General Public License 16 along with this program; if not, write to the Free Software 17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 19 $Id: CachableSource.java,v 1.2 2003/02/17 06:09:54 michaelh Exp $ 20 */ 21 22 package juju.reattore.io; 23 24 /*** A source that can be cached and that manages it's expiration and 25 re-use. 26 */ 27 public interface CachableSource { 28 29 /*** Called before the source is used, and may be used to mark this 30 source as expired and in need of re-generation. May not 31 always be called before re-use. 32 33 @return true If this source is expired and should be 34 re-loaded. 35 */ 36 boolean isExpired(); 37 38 /*** Releases this source from the cache. Used to release any 39 resources. 40 */ 41 void release(); 42 43 /*** Resets this source into the original state. Called before 44 placing back into the cache. 45 */ 46 void rewind(); 47 48 /*** Binds this source to a cache. The source must call 49 Cache.onClose() when closed and allow the cache to cancel the 50 close. 51 52 @param ch The cache to bind to. 53 */ 54 void setCacheCallback(Cache ch); 55 }

This page was automatically generated by Maven