|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.mortbay.http.HttpConnection
A HTTP Connection. This class provides the generic HTTP handling for a connection to a HTTP server. An instance of HttpConnection is normally created by a HttpListener and then given control in order to run the protocol handling before and after passing a request to the HttpServer of the HttpListener. This class is not synchronized as it should only ever be known to a single thread.
HttpListener
,
HttpServer
Fields inherited from interface org.mortbay.http.OutputObserver |
__CLOSED, __CLOSING, __COMMITED, __COMMITING, __FIRST_WRITE, __RESET_BUFFER |
Constructor Summary | |
HttpConnection(HttpListener listener,
java.net.InetAddress remoteAddr,
java.io.InputStream in,
java.io.OutputStream out,
java.lang.Object connection)
Constructor. |
Method Summary | |
void |
close()
Close the connection. |
void |
forceClose()
Force the connection to not be persistent. |
java.lang.Object |
getConnection()
Get the underlying connection object. |
java.lang.String |
getDefaultScheme()
Get the listeners Default scheme. |
java.lang.String |
getHost()
Get the listeners HttpServer . |
HttpServer |
getHttpServer()
Get the listeners HttpServer . |
ChunkableInputStream |
getInputStream()
Get the connections InputStream. |
HttpListener |
getListener()
Get the connections listener. |
java.lang.Object |
getObject()
Get associated object. |
ChunkableOutputStream |
getOutputStream()
Get the connections OutputStream. |
int |
getPort()
Get the listeners Port . |
java.net.InetAddress |
getRemoteAddr()
Get the Remote address. |
java.lang.String |
getRemoteHost()
Get the Remote address as a String. |
HttpRequest |
getRequest()
Get the request. |
HttpResponse |
getResponse()
Get the response. |
void |
handle()
Handle the connection. |
boolean |
handleNext()
Handle next request off the connection. |
void |
outputNotify(ChunkableOutputStream out,
int action)
Output Notifications. |
void |
setObject(java.lang.Object o)
Set associated object. |
void |
setupOutputStream()
Setup the reponse output stream. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public HttpConnection(HttpListener listener, java.net.InetAddress remoteAddr, java.io.InputStream in, java.io.OutputStream out, java.lang.Object connection)
listener
- The listener that created this connection.remoteAddr
- The address of the remote end or null.in
- InputStream to read request(s) from.out
- OutputputStream to write response(s) to.connection
- The underlying connection object, most likely
a socket. This is not used by HttpConnection other than to make
it available via getConnection().Method Detail |
public java.net.InetAddress getRemoteAddr()
public java.lang.String getRemoteHost()
public ChunkableInputStream getInputStream()
public ChunkableOutputStream getOutputStream()
public java.lang.Object getConnection()
public HttpRequest getRequest()
public HttpResponse getResponse()
public void forceClose()
public void close() throws java.io.IOException
java.io.IOException
- public HttpListener getListener()
public HttpServer getHttpServer()
public java.lang.String getDefaultScheme()
public java.lang.String getHost()
public int getPort()
public java.lang.Object getObject()
public void setObject(java.lang.Object o)
o
- An object associated with the connecton.public void outputNotify(ChunkableOutputStream out, int action) throws java.io.IOException
outputNotify
in interface OutputObserver
out
- The output stream observed.action
- The action.ChunkableOutputStream
public void setupOutputStream() throws java.io.IOException
public void handle()
public boolean handleNext()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |