rabbit.proxy
Class RandomCacheResourceSource
java.lang.Object
rabbit.httpio.FileResourceSource
rabbit.proxy.CacheResourceSource
rabbit.proxy.RandomCacheResourceSource
- All Implemented Interfaces:
- ResourceSource, Transferable
public class RandomCacheResourceSource
- extends CacheResourceSource
A resource that gets ranges from the cache.
This resource will read data from disk so it may block.
- Author:
- Robert Olofsson
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RandomCacheResourceSource
public RandomCacheResourceSource(Cache<HttpHeader,HttpHeader> cache,
rabbit.proxy.RequestHandler rh,
NioHandler tr,
BufferHandler bufHandler,
List<Range> ranges,
long totalSize)
throws IOException
- Throws:
IOException
supportsTransfer
public boolean supportsTransfer()
- FileChannels can only be partially used so go with blocks.
- Specified by:
supportsTransfer
in interface ResourceSource
- Overrides:
supportsTransfer
in class FileResourceSource
- Returns:
- false
addBlockListener
public void addBlockListener(BlockListener listener)
- Description copied from class:
FileResourceSource
- Generally we do not come into this method, but it can happen..
- Specified by:
addBlockListener
in interface ResourceSource
- Overrides:
addBlockListener
in class FileResourceSource