|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
HTTP Listener. This interface describes the methods of a generic request listener for the HttpServer. Once a HttpListener is started, it is responsible for listening for new connections. Once a new connection is accepted it should be handled by creating a HttpConnection instance and calling either the HttpConnection.handle() or HttpConnection.handleNext() methods from a Thread allocated to that connection.
HttpConnection
,
HttpServer
Field Summary | |
static java.lang.String |
ATTRIBUTE
|
Method Summary | |
void |
customizeRequest(HttpConnection connection,
HttpRequest request)
Customize a request for a listener/connection combination. |
int |
getBufferReserve()
Get the size of the header reserve area. |
int |
getBufferSize()
Get the size of the buffers used by connections from this listener. |
int |
getConfidentialPort()
Get the protocol port to use for confidential redirections. |
java.lang.String |
getConfidentialScheme()
Get the protocol scheme to use for confidential redirections. |
java.lang.String |
getDefaultScheme()
Get the default scheme for requests. |
java.lang.String |
getHost()
Get the host or IP of the interface used by this listener. |
HttpServer |
getHttpServer()
Get the HttpServer instance for this HttpListener. |
int |
getIntegralPort()
Get the protocol port to use for integral redirections. |
java.lang.String |
getIntegralScheme()
Get the protocol scheme to use for integral redirections. |
int |
getPort()
Get the port number of the listener. |
boolean |
isConfidential(HttpConnection connection)
Get the confidential status of a connection. |
boolean |
isIntegral(HttpConnection connection)
Get the integral status of a connection. |
boolean |
isLowOnResources()
Get the low on resources state of the listener. |
boolean |
isOutOfResources()
Get the out of resources state of the listener. |
void |
persistConnection(HttpConnection connection)
Prepare a connection for persistance. |
void |
setHost(java.lang.String host)
Set the host or IP of the interface used by this listener. |
void |
setHttpServer(HttpServer server)
Set the HttpServer instance for this HttpListener. |
void |
setPort(int port)
Set the port number of the listener. |
Methods inherited from interface org.mortbay.util.LifeCycle |
isStarted, start, stop |
Field Detail |
public static final java.lang.String ATTRIBUTE
Method Detail |
public void setHttpServer(HttpServer server)
server
- The HttpServer instance this HttpListener has been added to.public HttpServer getHttpServer()
public void setHost(java.lang.String host) throws java.net.UnknownHostException
host
- The hostname or IP address of the interface used by this
listeners. If null or "0.0.0.0" then all available interfaces are used
by this listener.
java.net.UnknownHostException
public java.lang.String getHost()
public void setPort(int port)
port
- The TCP/IP port number to be used by this listener.public int getPort()
public int getBufferSize()
public int getBufferReserve()
public java.lang.String getDefaultScheme()
public void customizeRequest(HttpConnection connection, HttpRequest request)
connection
- The connection the request was received on, which must
be a HttpConnection created by this listener.request
- The request to customize.public void persistConnection(HttpConnection connection)
connection
- The perstent connection, which must be a
HttpConnection created by this listener.public boolean isLowOnResources()
public boolean isOutOfResources()
public boolean isIntegral(HttpConnection connection)
connection
- The connection to test.
public java.lang.String getIntegralScheme()
public int getIntegralPort()
public boolean isConfidential(HttpConnection connection)
connection
- The connection to test.
public java.lang.String getConfidentialScheme()
public int getConfidentialPort()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |