|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.jetty.server.HttpConnection
public class HttpConnection
A HttpConnection represents the connection of a HTTP client to the server
and is created by an instance of a Connector. It's prime function is
to associate Request and Response instances with a EndPoint.
A connection is also the prime mechanism used by jetty to recycle objects without
pooling. The Request, Response, HttpParser, HttpGenerator
and HttpFields instances are all recycled for the duraction of
a connection. Where appropriate, allocated buffers are also kept associated
with the connection via the parser and/or generator.
| Nested Class Summary | |
|---|---|
class |
HttpConnection.Output
|
class |
HttpConnection.OutputWriter
|
| Field Summary | |
|---|---|
protected Connector |
_connector
|
protected EndPoint |
_endp
|
protected Generator |
_generator
|
protected javax.servlet.ServletInputStream |
_in
|
protected HttpConnection.Output |
_out
|
protected Parser |
_parser
|
protected java.io.PrintWriter |
_printWriter
|
protected Request |
_request
|
protected HttpFields |
_requestFields
|
protected Response |
_response
|
protected HttpFields |
_responseFields
|
protected Server |
_server
|
protected HttpURI |
_uri
|
protected HttpConnection.OutputWriter |
_writer
|
| Constructor Summary | |
|---|---|
|
HttpConnection(Connector connector,
EndPoint endpoint,
Server server)
Constructor |
protected |
HttpConnection(Connector connector,
EndPoint endpoint,
Server server,
Parser parser,
Generator generator,
Request request)
|
| Method Summary | |
|---|---|
void |
cancelTimeout(Timeout.Task task)
|
void |
commitResponse(boolean last)
|
void |
completeResponse()
|
void |
flushResponse()
|
java.lang.Object |
getAssociatedObject()
|
Connector |
getConnector()
|
static HttpConnection |
getCurrentConnection()
|
EndPoint |
getEndPoint()
|
Generator |
getGenerator()
|
javax.servlet.ServletInputStream |
getInputStream()
Get the inputStream from the connection. |
javax.servlet.ServletOutputStream |
getOutputStream()
|
Parser |
getParser()
|
java.io.PrintWriter |
getPrintWriter(java.lang.String encoding)
|
Request |
getRequest()
|
HttpFields |
getRequestFields()
|
int |
getRequests()
|
boolean |
getResolveNames()
|
Response |
getResponse()
|
HttpFields |
getResponseFields()
|
long |
getTimeStamp()
|
void |
handle()
|
protected void |
handleRequest()
|
void |
include()
|
void |
included()
|
boolean |
isConfidential(Request request)
|
boolean |
isExpecting100Continues()
|
boolean |
isExpecting102Processing()
|
boolean |
isIdle()
|
boolean |
isIncluding()
|
boolean |
isIntegral(Request request)
Find out if the request is INTEGRAL security. |
boolean |
isResponseCommitted()
|
boolean |
isSuspended()
|
void |
reset(boolean returnBuffers)
|
void |
scheduleTimeout(Timeout.Task task,
long timeoutMs)
|
void |
setAssociatedObject(java.lang.Object associatedObject)
|
protected static void |
setCurrentConnection(HttpConnection connection)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final Connector _connector
protected final EndPoint _endp
protected final Server _server
protected final HttpURI _uri
protected final Parser _parser
protected final HttpFields _requestFields
protected final Request _request
protected javax.servlet.ServletInputStream _in
protected final Generator _generator
protected final HttpFields _responseFields
protected final Response _response
protected HttpConnection.Output _out
protected HttpConnection.OutputWriter _writer
protected java.io.PrintWriter _printWriter
| Constructor Detail |
|---|
public HttpConnection(Connector connector,
EndPoint endpoint,
Server server)
protected HttpConnection(Connector connector,
EndPoint endpoint,
Server server,
Parser parser,
Generator generator,
Request request)
| Method Detail |
|---|
public static HttpConnection getCurrentConnection()
protected static void setCurrentConnection(HttpConnection connection)
public Parser getParser()
public int getRequests()
public long getTimeStamp()
public java.lang.Object getAssociatedObject()
public void setAssociatedObject(java.lang.Object associatedObject)
associatedObject - The associatedObject to set.public Connector getConnector()
public HttpFields getRequestFields()
public HttpFields getResponseFields()
public boolean isConfidential(Request request)
getConnector().isCondidential(request), or false
if there is no connector.public boolean isIntegral(Request request)
request -
true if there is a connector and it considers request
to be integralpublic EndPoint getEndPoint()
EndPoint for this connection.public boolean getResolveNames()
false (this method is not yet implemented)public Request getRequest()
public Response getResponse()
public javax.servlet.ServletInputStream getInputStream()
throws java.io.IOException
If the associated response has the Expect header set to 100 Continue, then accessing the input stream indicates that the handler/servlet is ready for the request body and thus a 100 Continue response is sent.
java.io.IOExceptionpublic javax.servlet.ServletOutputStream getOutputStream()
public java.io.PrintWriter getPrintWriter(java.lang.String encoding)
PrintWriter wrapping the output stream. The writer is created if it
does not already exist.public boolean isResponseCommitted()
public void handle()
throws java.io.IOException
handle in interface Connectionjava.io.IOException
public void scheduleTimeout(Timeout.Task task,
long timeoutMs)
public void cancelTimeout(Timeout.Task task)
public void reset(boolean returnBuffers)
protected void handleRequest()
throws java.io.IOException
java.io.IOException
public void commitResponse(boolean last)
throws java.io.IOException
java.io.IOException
public void completeResponse()
throws java.io.IOException
java.io.IOException
public void flushResponse()
throws java.io.IOException
java.io.IOExceptionpublic Generator getGenerator()
public boolean isIncluding()
public void include()
public void included()
public boolean isIdle()
isIdle in interface Connectionpublic boolean isSuspended()
isSuspended in interface ConnectionConnection.isSuspended()public boolean isExpecting100Continues()
public boolean isExpecting102Processing()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||