All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class sun.servlet.http.HttpServerHandler

java.lang.Object
   |
   +----sun.servlet.http.HttpServerHandler

public class HttpServerHandler
extends Object
implements Runnable, ServletConnection
This class represents a connection handler in the servlet server.


Variable Index

 o buf
Temporary buffer for file requests.
 o PREFIX
The URL prefix for invoking servlets.
 o PREFIX_LEN
The servlet URL prefix length.
 o req
The servlet request.
 o res
The servlet response.
 o server
The server for this handler.
 o socket
The current socket connection.

Constructor Index

 o HttpServerHandler(HttpServer)
Creates a new handler for the specified server.

Method Index

 o getInputStream()
Returns the input stream for reading from the connection.
 o getOutputStream()
Returns the output stream for writing to the connection.
 o getRealPath(String)
Returns the translated path for the specified virtual path.
 o getRemoteAddr()
Returns the remote address of the socket connection.
 o getRemoteHost()
Returns the local port of the socket connection.
 o getServerName()
Returns the host name of the server.
 o getServerPort()
Returns the post number of the server.
 o handleConnection(Socket)
Handles a single connection from the client.
 o parsePath(MessageBytes, HttpRequest)
Parses a servlet path.
 o run()
Runs the connection handler.
 o sendFile(MessageBytes, HttpResponse)
Fetches a file from the document tree.
 o sendResponse(HttpRequest, HttpResponse)
Sends a response to the client.

Variables

 o server
  protected HttpServer server
The server for this handler.

 o req
  protected final HttpRequest req
The servlet request.

 o res
  protected final HttpResponse res
The servlet response.

 o socket
  protected Socket socket
The current socket connection.

 o buf
  protected byte buf[]
Temporary buffer for file requests.

 o PREFIX
  protected static String PREFIX
The URL prefix for invoking servlets.

 o PREFIX_LEN
  protected static int PREFIX_LEN
The servlet URL prefix length.

Constructors

 o HttpServerHandler
  protected HttpServerHandler(HttpServer server)
Creates a new handler for the specified server.

Methods

 o run
  public void run()
Runs the connection handler.

 o handleConnection
  protected void handleConnection(Socket s) throws IOException
Handles a single connection from the client.

Parameters:
s - the connection socket
 o sendResponse
  protected void sendResponse(HttpRequest req,
                              HttpResponse res) throws ServletException, IOException
Sends a response to the client.

 o parsePath
  protected String parsePath(MessageBytes path,
                             HttpRequest req)
Parses a servlet path. Returns the name of the servlet or null if the path was invalid.

 o sendFile
  protected void sendFile(MessageBytes path,
                          HttpResponse res) throws IOException
Fetches a file from the document tree.

 o getServerName
  public String getServerName()
Returns the host name of the server.

 o getServerPort
  public int getServerPort()
Returns the post number of the server.

 o getRemoteHost
  public String getRemoteHost()
Returns the local port of the socket connection.

 o getRemoteAddr
  public String getRemoteAddr()
Returns the remote address of the socket connection.

 o getRealPath
  public String getRealPath(String path)
Returns the translated path for the specified virtual path.

 o getInputStream
  public InputStream getInputStream() throws IOException
Returns the input stream for reading from the connection.

 o getOutputStream
  public OutputStream getOutputStream() throws IOException
Returns the output stream for writing to the connection.


All Packages  Class Hierarchy  This Package  Previous  Next  Index