|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectrabbit.httpio.WebConnectionResourceSource
public class WebConnectionResourceSource
A resource source that gets the data from a WebConnection
| Constructor Summary | |
|---|---|
WebConnectionResourceSource(ConnectionHandler con,
NioHandler nioHandler,
WebConnection wc,
BufferHandle bufHandle,
TrafficLogger tl,
boolean isChunked,
long dataSize,
boolean strictHttp)
Create a new ConnectionResourceSource that gets the data from the network. |
|
| Method Summary | |
|---|---|
void |
addBlockListener(BlockListener listener)
Add a ByteBuffer listener. |
void |
closed()
|
void |
finishedRead()
Chunk reading has been completed. |
java.lang.String |
getDescription()
|
java.lang.Long |
getTimeout()
|
long |
length()
Get the length of the resource in bytes. |
void |
read()
|
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. |
boolean |
supportsTransfer()
FileChannels can not be used, will always return false. |
void |
timeout()
|
long |
transferTo(long position,
long count,
java.nio.channels.WritableByteChannel target)
Transfers bytes from this channel's file to the given writable byte channel. |
boolean |
useSeparateThread()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public WebConnectionResourceSource(ConnectionHandler con,
NioHandler nioHandler,
WebConnection wc,
BufferHandle bufHandle,
TrafficLogger tl,
boolean isChunked,
long dataSize,
boolean strictHttp)
con - the Connection handling the requestnioHandler - the NioHandler to use for network and background taskswc - the WebConection connected to the upstream serverbufHandle - the BufferHandle to usetl - the TrafficLogger to use for network statisticsisChunked - flag indicating if the upstream data is chunked or notdataSize - the size of the data, may be -1 if size is unknownstrictHttp - if true strict http will be used when communcating
with the upstream server| Method Detail |
|---|
public java.lang.String getDescription()
getDescription in interface SocketChannelHandlerpublic boolean supportsTransfer()
supportsTransfer in interface ResourceSourcepublic long length()
Transferable
length in interface Transferable
public long transferTo(long position,
long count,
java.nio.channels.WritableByteChannel target)
throws java.io.IOException
Transferable
transferTo in interface Transferableposition - 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
java.io.IOException - if data transfer failstransferTopublic void addBlockListener(BlockListener listener)
ResourceSource
addBlockListener in interface ResourceSourcelistener - the listener that will get notified when data is availablepublic void finishedRead()
ChunkDataFeeder
finishedRead in interface ChunkDataFeederpublic void register()
ChunkDataFeeder
register in interface ChunkDataFeederpublic void readMore()
ChunkDataFeeder
readMore in interface ChunkDataFeederpublic void read()
read in interface ReadHandlerpublic boolean useSeparateThread()
useSeparateThread in interface SocketChannelHandlerpublic void closed()
closed in interface SocketChannelHandlerpublic void timeout()
timeout in interface SocketChannelHandlerpublic java.lang.Long getTimeout()
getTimeout in interface SocketChannelHandlerpublic void release()
ResourceSource
release in interface ResourceSource
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||