|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.codehaus.spice.netserve.connection.handlers.AbstractRequestHandler
Abstract base class for request handlers.
| Constructor Summary | |
AbstractRequestHandler()
|
|
| Method Summary | |
protected Runnable |
createRunnable(Socket socket)
Create Runnable to perform the request. |
protected abstract void |
doPerformRequest(Socket socket)
Method implemented to actually do the work. |
protected void |
endConnection(Socket socket)
End connection for socket. |
protected void |
errorClosingConnection(Socket socket,
Throwable t)
Notify handler of an error closing socket. |
protected void |
errorHandlingConnection(Socket socket,
Throwable t)
Notify handler of an error handling socket. |
protected String |
getThreadName(Socket socket)
Return the name should be set for current thread. |
void |
handleConnection(Socket socket)
Handle a connection. |
protected boolean |
isShutdown()
Return true if handler has been shutdown. |
protected void |
markAsShutdown()
Mark request handler as shutdown. |
protected void |
performRequest(Socket socket)
Perform the request for socket by delegating to underlying handler. |
protected void |
setupThreadName(Socket socket)
Setup the name of the thread. |
void |
shutdown(long timeout)
Shutdown the handler and any requests currently being handled. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public AbstractRequestHandler()
| Method Detail |
public void handleConnection(Socket socket)
handleConnection in interface RequestHandlersocket - the socketpublic void shutdown(long timeout)
RequestHandler
shutdown in interface RequestHandlertimeout - the timeoutRequestHandler.shutdown(long)protected void markAsShutdown()
protected boolean isShutdown()
protected void performRequest(Socket socket)
socket - the socket to handle
protected abstract void doPerformRequest(Socket socket)
throws Exception
socket - the socket
Exception - if an error occursprotected void setupThreadName(Socket socket)
socket - the socket associated with requestprotected void endConnection(Socket socket)
socket - the socketprotected Runnable createRunnable(Socket socket)
socket - the socket to handle
protected String getThreadName(Socket socket)
socket - the socket being handled in thread
protected void errorHandlingConnection(Socket socket,
Throwable t)
socket - the sockett - the error
protected void errorClosingConnection(Socket socket,
Throwable t)
socket - the sockett - the error
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||