|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.benow.web.servlet.RequestHandler
public abstract class RequestHandler
RequestHandler is a ControlledThread which handles a single request. The servlet request comes in and a handler is taken from a pool and invoked to handle the request. If no handler is present, a new handler is created. This (pooled) multi-threaded handler approach is more efficient on smp/hyperthread boxen, and each thread is discrete. More memory is used, however.
| Field Summary | |
|---|---|
static java.lang.String |
ENV_PARAMS
|
static java.lang.String |
ENV_REQUEST
|
static java.lang.String |
ENV_REQUEST_URL
|
static java.lang.String |
ENV_RESPONSE
|
static java.lang.String |
ENV_SESSION
|
protected QueryParams |
params
|
protected javax.servlet.http.HttpServletRequest |
request
|
protected javax.servlet.http.HttpServletResponse |
response
|
protected javax.servlet.http.HttpSession |
session
|
protected java.lang.String |
url
|
| Constructor Summary | |
|---|---|
RequestHandler(HandlerServlet servlet)
|
|
| Method Summary | |
|---|---|
protected boolean |
beforeRun(RequestHandlerThread thread)
Override to add to handler thread environment |
protected void |
dirtyRun()
Handles the request, throwing any unhandled errors. |
protected java.lang.Object |
doRun(java.io.OutputStream out)
|
protected java.lang.Object |
doRun(java.io.PrintWriter out)
|
protected java.lang.Object |
doRun(java.io.Writer out)
|
protected void |
dumpError(java.io.PrintWriter out,
int code,
java.lang.String message,
java.lang.Throwable t)
|
java.lang.String |
getContentType()
Gets the default content type if no type has been previously specified (ie in beforeRun) |
protected void |
handleError(java.io.OutputStream out,
int code,
java.lang.String message,
java.lang.Throwable t)
|
protected void |
handleError(java.io.OutputStream out,
java.lang.Throwable t)
|
protected void |
handleError(java.io.PrintWriter out,
int code,
java.lang.String message,
java.lang.Throwable t)
|
protected void |
handleError(java.io.PrintWriter out,
java.lang.Throwable t)
|
void |
handleRequest(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.String url)
Handle the delivery of the page. |
void |
run()
|
protected void |
startRun(java.io.OutputStream out)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String ENV_SESSION
public static final java.lang.String ENV_PARAMS
public static final java.lang.String ENV_RESPONSE
public static final java.lang.String ENV_REQUEST
public static final java.lang.String ENV_REQUEST_URL
protected QueryParams params
protected java.lang.String url
protected javax.servlet.http.HttpServletRequest request
protected javax.servlet.http.HttpServletResponse response
protected javax.servlet.http.HttpSession session
| Constructor Detail |
|---|
public RequestHandler(HandlerServlet servlet)
| Method Detail |
|---|
public void handleRequest(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.String url)
throws java.lang.Throwable
url -
java.lang.Throwable
java.lang.SecurityException
WebException
protected boolean beforeRun(RequestHandlerThread thread)
throws WebException
thread -
WebExceptionpublic void run()
run in interface java.lang.Runnable
protected void dirtyRun()
throws java.lang.Throwable
java.lang.Throwablepublic java.lang.String getContentType()
protected void startRun(java.io.OutputStream out)
throws java.lang.Exception
java.lang.Exception
protected void handleError(java.io.OutputStream out,
java.lang.Throwable t)
protected void handleError(java.io.PrintWriter out,
java.lang.Throwable t)
throws java.io.IOException,
RedirectException
java.io.IOException
RedirectException
protected final void handleError(java.io.OutputStream out,
int code,
java.lang.String message,
java.lang.Throwable t)
protected final void handleError(java.io.PrintWriter out,
int code,
java.lang.String message,
java.lang.Throwable t)
throws java.io.IOException,
RedirectException
java.io.IOException
RedirectException
protected void dumpError(java.io.PrintWriter out,
int code,
java.lang.String message,
java.lang.Throwable t)
throws java.io.IOException,
RedirectException
java.io.IOException
RedirectException
protected java.lang.Object doRun(java.io.OutputStream out)
throws java.lang.Exception
java.lang.Exception
protected java.lang.Object doRun(java.io.Writer out)
throws java.lang.Exception
java.lang.Exception
protected java.lang.Object doRun(java.io.PrintWriter out)
throws java.lang.Exception
java.lang.Exception
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||