"Fossies" - the Fresh Open Source Software archive 
Member "rabbit4.11/htdocs/javadoc/rabbit/proxy/RandomCacheResourceSource.html" of archive rabbit4.11-bin.tar.gz:
Caution: In this restricted "Fossies" environment the current HTML page may not be correctly presentated and may have some non-functional links.
Alternatively you can here view or download the uninterpreted source code.
That can be also achieved for any archive member file by clicking within an archive contents listing on the first character of the file(path) respectively on the according byte size field.
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
- Create a new ResourceSource that will get a list of ranges from a
cached resource.
- Parameters:
cache - the Cache holding the resourcerh - the RequestHandler for the requesttr - the NioHandler to use for network and background tasksbufHandler - the BufferHandler to use when serving the resourceranges - the wanted rangestotalSize - the total size of the wanted ranges
- Throws:
IOException - if the cached resource can not be read
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
- Parameters:
listener - the listener that will get notified when data is available