juju.reattore.io
Interface CachableSource

All Known Implementing Classes:
ChannelFileSource

public interface CachableSource

A source that can be cached and that manages it's expiration and re-use.


Method Summary
 boolean isExpired()
          Called before the source is used, and may be used to mark this source as expired and in need of re-generation.
 void release()
          Releases this source from the cache.
 void rewind()
          Resets this source into the original state.
 void setCacheCallback(Cache ch)
          Binds this source to a cache.
 

Method Detail

isExpired

public boolean isExpired()
Called before the source is used, and may be used to mark this source as expired and in need of re-generation. May not always be called before re-use.

Returns:
true If this source is expired and should be re-loaded.

release

public void release()
Releases this source from the cache. Used to release any resources.


rewind

public void rewind()
Resets this source into the original state. Called before placing back into the cache.


setCacheCallback

public void setCacheCallback(Cache ch)
Binds this source to a cache. The source must call Cache.onClose() when closed and allow the cache to cancel the close.

Parameters:
ch - The cache to bind to.


Copyright © 2002-2003 Michael Hope. All Rights Reserved.