|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface HttpListener
HTTP Listener. This interface describes the methods of a generic request listener for the HttpServer. This class should probably be called HttpConnector, but it's name predates the EventListener API in java. 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 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. |
String |
getConfidentialScheme()
Get the protocol scheme to use for confidential redirections. |
String |
getDefaultScheme()
Get the default scheme for requests. |
String |
getHost()
Get the host or IP of the interface used by this listener. |
HttpHandler |
getHttpHandler()
Get an optional HttpHandler for the listener. |
HttpServer |
getHttpServer()
Get the HttpServer instance for this HttpListener. |
int |
getIntegralPort()
Get the protocol port to use for integral redirections. |
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(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.openqa.jetty.util.LifeCycle |
---|
isStarted, start, stop |
Field Detail |
---|
static final String ATTRIBUTE
Method Detail |
---|
void setHttpServer(HttpServer server)
server
- The HttpServer instance this HttpListener has been added to.HttpServer getHttpServer()
void setHost(String host) throws 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.
UnknownHostException
String getHost()
void setPort(int port)
port
- The TCP/IP port number to be used by this listener.int getPort()
int getBufferSize()
int getBufferReserve()
String getDefaultScheme()
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.void persistConnection(HttpConnection connection)
connection
- The perstent connection, which must be a
HttpConnection created by this listener.boolean isLowOnResources()
boolean isOutOfResources()
boolean isIntegral(HttpConnection connection)
connection
- The connection to test.
String getIntegralScheme()
int getIntegralPort()
boolean isConfidential(HttpConnection connection)
connection
- The connection to test.
String getConfidentialScheme()
int getConfidentialPort()
HttpHandler getHttpHandler()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |