public class HttpRequestChannel extends HttpMessageChannel<HttpRequest>
This class implements a reader which reads from the input-stream
and parses http-requests. The requests are queued and can be fetched
by getRequest().
| Modifier and Type | Field and Description |
|---|---|
static org.slf4j.Logger |
log |
static String |
TIMEOUT_PROPERTY |
STATE_READING_BODY, STATE_READING_HEADER| Constructor and Description |
|---|
HttpRequestChannel(InputStream in) |
HttpRequestChannel(ReadableByteChannel in)
Creates a HttpRequestStream which parses requests from the given input-stream.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
This method closes the message-channel and also closes the
underlying byte-channel.
|
int |
getNumberOfRequests() |
HttpRequest |
readMessage() |
HttpRequest |
readRequest()
This method returns the next complete request in the input-stream.
|
String |
toString() |
getState, getTimeout, readBody, readHeader, setTimeout, timedOut, touchpublic static final String TIMEOUT_PROPERTY
public static org.slf4j.Logger log
public HttpRequestChannel(ReadableByteChannel in) throws IOException
cid-string is used for logging.in - IOExceptionpublic HttpRequestChannel(InputStream in) throws IOException
IOExceptionpublic HttpRequest readMessage() throws TimeOutException, IOException, ProtocolException
readMessage in class HttpMessageChannel<HttpRequest>TimeOutExceptionIOExceptionProtocolExceptionpublic HttpRequest readRequest() throws TimeOutException, IOException, ProtocolException
TimeOutExceptionIOExceptionProtocolExceptionpublic void close()
throws IOException
HttpMessageChannelclose in class HttpMessageChannel<HttpRequest>IOException - In case closing the underlying byte-channel
resulted in an I/O error.public int getNumberOfRequests()
Copyright © 2015 jwall.org. All Rights Reserved.