org.mortbay.http
public class SocketListener extends ThreadedServer implements HttpListener
MinThreads - Minumum threads waiting to service requests.
MaxThread - Maximum thread that will service requests.
MaxIdleTimeMs - Time for an idle thread to wait for a request or read.
LowResourcePersistTimeMs - time in ms that connections will persist if listener is
low on resources.
Version: $Id: SocketListener.java,v 1.39 2006/02/27 13:03:50 gregwilkins Exp $
| Constructor Summary | |
|---|---|
| SocketListener() | |
| SocketListener(InetAddrPort address) | |
| Method Summary | |
|---|---|
| protected HttpConnection | createConnection(Socket socket) Create an HttpConnection instance. |
| void | customizeRequest(HttpConnection connection, HttpRequest request) Customize the request from connection.
|
| protected void | customizeRequest(Socket socket, HttpRequest request) Customize request from socket.
|
| int | getBufferReserve() |
| int | getBufferSize() |
| int | getConfidentialPort() |
| String | getConfidentialScheme() |
| String | getDefaultScheme() |
| HttpHandler | getHttpHandler() |
| HttpServer | getHttpServer() |
| boolean | getIdentifyListener() |
| int | getIntegralPort() |
| String | getIntegralScheme() |
| int | getLowResourcePersistTimeMs() |
| int | getLowResources() |
| void | handleConnection(Socket socket) Handle Job.
|
| boolean | isConfidential(HttpConnection connection) |
| boolean | isIntegral(HttpConnection connection) |
| boolean | isLowOnResources() Get the lowOnResource state of the listener.
|
| boolean | isOutOfResources() Get the outOfResource state of the listener.
|
| void | persistConnection(HttpConnection connection) Persist the connection.
|
| void | setBufferReserve(int size) |
| void | setBufferSize(int size) |
| void | setConfidentialPort(int confidentialPort) |
| void | setConfidentialScheme(String confidentialScheme) |
| void | setDefaultScheme(String scheme) |
| void | setHttpHandler(HttpHandler handler) |
| void | setHttpServer(HttpServer server) |
| void | setIdentifyListener(boolean identifyListener) |
| void | setIntegralPort(int integralPort) |
| void | setIntegralScheme(String integralScheme) |
| void | setLowResourcePersistTimeMs(int ms) Set the low resource persistace time.
|
| void | setLowResources(int lowResources) |
| void | start() |
| void | stop() |
Parameters: socket The underlying socket.
Parameters: request
Parameters: request
Returns: time in ms that connections will persist if listener is low on resources.
Returns: Returns the lowResources threshold
Parameters: socket A Connection.
Returns: True if low on idle threads.
Returns: True if out of resources.
Parameters: connection The HttpConnection to use.
Parameters: identifyListener If true, the listener name is added to all requests as the org.mortbay.http.HttListener attribute
Parameters: ms time in ms that connections will persist if listener is low on resources.
Parameters: lowResources The number of idle threads needed to not be in low resources state.