|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object SK.gnome.dwarf.GenericService SK.gnome.dwarf.thread.ThreadService SK.gnome.dwarf.thread.Handler SK.gnome.dwarf.tcpip.TCPHandler SK.gnome.dwarf.http.HTTPHandler
This class handles the HTTP connections.
The handler is able to automatically invoke the HTTP authentication methods,
and it handles also displaying of custom error pages, defined by the web
applications. It provides a detailed report via the report()
method.
HTTPHandler must be added to the HTTPServer
object.
Field Summary |
Fields inherited from class SK.gnome.dwarf.thread.ThreadService |
daemon, thread |
Fields inherited from class SK.gnome.dwarf.GenericService |
initParameters, parent |
Fields inherited from interface SK.gnome.dwarf.Service |
INITIALIZED, LOG_DEBUG, LOG_ERROR, LOG_FATAL, LOG_INFO, LOG_TRACE, LOG_WARN, LOG_XFER, SHUTDOWN, STARTED, STOPPED |
Constructor Summary | |
HTTPHandler(java.lang.String name)
Creates a new HTTPHandler. |
Method Summary | |
protected int |
getShutdownTimeout()
Returns the shutdown timeout. |
protected void |
handle(java.net.Socket socket)
Handles the HTTP connection. |
void |
init(SK.gnome.dwarf.Server parent)
Initializes the service. |
java.lang.String |
report()
Returns the service report. |
Methods inherited from class SK.gnome.dwarf.tcpip.TCPHandler |
handle |
Methods inherited from class SK.gnome.dwarf.thread.Handler |
enableThread, loop, start |
Methods inherited from class SK.gnome.dwarf.thread.ThreadService |
finish, run, setDaemon, shutdown, stop |
Methods inherited from class SK.gnome.dwarf.GenericService |
getAuthenticator, getAuthFacility, getFullName, getInitParameter, getInitParameterNames, getLogFacility, getLogger, getName, getParameters, getPrincipal, getState, log, log, login, logout, setAuthFacility, setInitParameters, setLogFacility, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public HTTPHandler(java.lang.String name)
Method Detail |
public void init(SK.gnome.dwarf.Server parent) throws SK.gnome.dwarf.ServiceException
init
in interface SK.gnome.dwarf.Service
SK.gnome.dwarf.ServiceException
protected void handle(java.net.Socket socket)
It reads the information from the client socket and creates a new Request
object
as well as the Response
object. It then passes them to the RequestDispatcher
obtained from the request for processing. If an error occured during the request/response
life-cycle, a detailed message including the stack trace can be sent to the client if allowed
by the server configuration.
Persistent connections are handled automatically if enabled and can be adjusted to control
the server performance. See the HTTPParameters
class for more information about the
persistence-related parameters.
The report()
method returns a detailed information about the current handler's
activity.
protected int getShutdownTimeout()
It returns the Constants.DEFAULT_SHUTDOWN_TIMEOUT
value if the persistent
connections are not enabled, or the value returned from the getKeepAliveTimeout
method in the opposit case.
public java.lang.String report()
The first letter of each report string is 'R' for reading a new request, 'K' for processing a persistent (keep-alive) connection, 'C' for processing a non-persistent connection, and '_' indicates that the handler is idle. The initial letter is followed by the client's IP address and a detailed information about the request, if available.
Examples of the report strings:
_ handler is idle, i.e. it waits until a connection is available for processing R 192.168.1.1 handler reads a new client request K 192.168.1.1 handler reads a new client request from a persistent connection C 192.168.1.1 GET /logo.gif HTTP/1.0 handler processes a client request x handler is currently stopped
report
in interface SK.gnome.dwarf.Reportable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |