rabbit.proxy
Class CacheResourceSource

java.lang.Object
  extended by rabbit.httpio.FileResourceSource
      extended by rabbit.proxy.CacheResourceSource
All Implemented Interfaces:
ResourceSource, Transferable
Direct Known Subclasses:
RandomCacheResourceSource

public class CacheResourceSource
extends FileResourceSource

A resource that comes from the cache.

Author:
Robert Olofsson

Field Summary
 
Fields inherited from class rabbit.httpio.FileResourceSource
bufHandle, fc
 
Constructor Summary
CacheResourceSource(Cache<HttpHeader,HttpHeader> cache, CacheEntry<HttpHeader,HttpHeader> entry, NioHandler tr, BufferHandler bufHandler)
          Create a new CacheResourceSource.
 
Method Summary
 
Methods inherited from class rabbit.httpio.FileResourceSource
addBlockListener, length, release, supportsTransfer, transferTo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CacheResourceSource

public CacheResourceSource(Cache<HttpHeader,HttpHeader> cache,
                           CacheEntry<HttpHeader,HttpHeader> entry,
                           NioHandler tr,
                           BufferHandler bufHandler)
                    throws IOException
Create a new CacheResourceSource.

Parameters:
cache - the Cache that has the cached resource
entry - the CacheEntry for the resource
tr - the NioHandler to use for network and background tasks when serving this resource
bufHandler - the BufferHandler to use for this resource
Throws:
IOException - if the cached resource is not available