juju.reattore.server.intercept.impl
Class FileCache

java.lang.Object
  |
  +--juju.reattore.server.intercept.impl.FileCache

public class FileCache
extends java.lang.Object

A simple request based cache for ChannelFileSources.


Constructor Summary
FileCache()
           
 
Method Summary
 ByteSource get(java.lang.String req, java.io.File resolved)
          Fetch from the cache or from disk, throwing on failure.
 ByteSource tryGet(java.lang.String req)
          Attempt to fetch from the cache.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileCache

public FileCache()
Method Detail

tryGet

public ByteSource tryGet(java.lang.String req)
Attempt to fetch from the cache.

Parameters:
req - The request key to fetch.
Returns:
The data, or null on cache miss.

get

public ByteSource get(java.lang.String req,
                      java.io.File resolved)
               throws java.io.IOException
Fetch from the cache or from disk, throwing on failure.

Parameters:
req - The request key to fetch.
resolved - The file to fetch from.
Returns:
The data, or null on cache miss.
Throws:
java.io.IOException - from the ChannelFileSource if the file can't be found.


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