|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object rabbit.httpio.WebConnectionResourceSource
public class WebConnectionResourceSource
A resource source that gets the data from a WebConnection
Constructor Summary | |
---|---|
WebConnectionResourceSource(ConnectionHandler con,
Selector selector,
WebConnection wc,
BufferHandle bufHandle,
Logger logger,
TrafficLogger tl,
boolean isChunked,
long dataSize,
boolean strictHttp)
|
Method Summary | |
---|---|
void |
addBlockListener(BlockListener listener)
Add a ByteBuffer listener. |
void |
finishedRead()
Chunk reading has been completed. |
String |
getDescription()
Get a string description. |
long |
length()
Get the length of the resource in bytes. |
void |
readMore()
The chunk reader needs to read more data, compact buffer before registering. |
void |
register()
The chunk reader needs more data. |
void |
release()
Release any held resources. |
void |
run()
|
boolean |
supportsTransfer()
FileChannels can not be used, will always return false. |
void |
timeout()
Signal that the select operation timed out. |
long |
transferTo(long position,
long count,
WritableByteChannel target)
Transfers bytes from this channel's file to the given writable byte channel. |
boolean |
useSeparateThread()
Check if this handler needs to run in a separate thread. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WebConnectionResourceSource(ConnectionHandler con, Selector selector, WebConnection wc, BufferHandle bufHandle, Logger logger, TrafficLogger tl, boolean isChunked, long dataSize, boolean strictHttp)
Method Detail |
---|
public String getDescription()
SocketHandler
getDescription
in interface SocketHandler
public boolean supportsTransfer()
supportsTransfer
in interface ResourceSource
public long length()
Transferable
length
in interface Transferable
public long transferTo(long position, long count, WritableByteChannel target) throws IOException
Transferable
transferTo
in interface Transferable
position
- The position within the file at which the transfer
is to begin; must be non-negativecount
- The maximum number of bytes to be transferred;
must be non-negativetarget
- The target channel
IOException
transferTo
public void addBlockListener(BlockListener listener)
ResourceSource
addBlockListener
in interface ResourceSource
public void finishedRead()
ChunkDataFeeder
finishedRead
in interface ChunkDataFeeder
public void register()
ChunkDataFeeder
register
in interface ChunkDataFeeder
public void readMore()
ChunkDataFeeder
readMore
in interface ChunkDataFeeder
public void run()
run
in interface Runnable
public boolean useSeparateThread()
SocketHandler
useSeparateThread
in interface SocketHandler
public void timeout()
SocketHandler
timeout
in interface SocketHandler
public void release()
ResourceSource
release
in interface ResourceSource
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |