|
ZetaGrid v1.9 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--javax.servlet.GenericServlet
|
+--javax.servlet.http.HttpServlet
|
+--zeta.ZetaServlet
Creates an HTTP servlet that dispatches HTTP GET and HTTP POST requests on the ZetaGrid site to specified handlers.
| Field Summary | |
private ConnectionDriver |
connectionDriver
|
private java.io.Writer |
errorLog
|
private java.lang.String |
errorLogFilename
|
private java.util.List |
getHandlers
Map to handle HTTP GET requests. |
private int |
id
ID for logging. |
private java.text.SimpleDateFormat |
logFormat
|
private static int |
MAX_BACKUP_INDEX
|
private static long |
MAX_LOG_FILESIZE
|
private boolean |
normalLogging
|
private int |
numberOfStatisticHandlers
Number of handlers which handle HTTP GET requests for statistics. |
private java.util.Hashtable |
parameters
|
private int |
poolsize
|
private java.util.List |
postHandlers
Map to handle HTTP POST requests. |
private int |
serverId
ID of the server. |
private java.io.Writer |
stdLog
|
private java.lang.String |
stdLogFilename
|
| Fields inherited from class javax.servlet.http.HttpServlet |
|
| Fields inherited from class javax.servlet.GenericServlet |
|
| Constructor Summary | |
ZetaServlet()
Initialize lists to handle HTTP GET and HTTP POST requests. |
|
| Method Summary | |
void |
addStatisticHandler(java.lang.String name,
java.lang.String parameter,
java.util.List statisticHandlers)
Adds a statistic handler. |
void |
destroy()
Destroy the resources that are held for the life of the servlet. |
protected void |
doGet(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
Called by the server to allow this servlet to handle a GET request. |
protected void |
doPost(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
Called by the server to allow this servlet to handle a POST request. |
private java.lang.Object |
findHandler(java.util.List handlers,
java.lang.String name)
Searches the handler by the specified name. |
java.sql.Connection |
getConnection()
Returns a connection to the back-end database. |
java.lang.String |
getHandlerAddress(java.lang.Class handler)
Searches the handler address by the specified class of this GET handler. |
java.lang.String |
getInitParameter(java.lang.String name)
|
int |
getInitParameter(java.lang.String name,
int defaultValue)
|
java.util.Enumeration |
getInitParameterNames()
|
private java.lang.Object |
getInstance(java.lang.Class handlerClass)
Builds a new instance of the specified handler class |
int |
getNumberOfStatisticHandlers()
Returns the number of defined statistic handlers. |
int |
getServerId()
Returns the ID of the server. |
AbstractHandler |
getStatisticHandler(java.lang.Class handler)
Searches the handler object by the specified class of this statistic handler. |
java.lang.Class |
getStatisticHandlerClass(int i)
Returns the i-th defined statistic handler. |
java.lang.String |
getStatisticHandlerName(java.lang.Class handler)
Searches the handler name by the specified class of this statistic handler. |
boolean |
hasSeparateFiles()
|
void |
init()
Initialize the resources that are held for the life of the servlet. |
private void |
initLogFile()
|
void |
log(java.lang.String msg)
|
void |
log(java.lang.Throwable t)
|
private void |
rollOver(java.lang.String filename,
int maxBackupIndex)
Implements the usual roll over behaviour of log files. |
void |
setServerId(int serverId)
Sets the ID of the server. |
| Methods inherited from class javax.servlet.http.HttpServlet |
doDelete, doOptions, doPut, doTrace, getLastModified, service, service |
| Methods inherited from class javax.servlet.GenericServlet |
getServletConfig, getServletContext, getServletInfo, getServletName, init, log |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private java.util.Hashtable parameters
private java.util.List getHandlers
private java.util.List postHandlers
private int numberOfStatisticHandlers
private int serverId
private int id
private int poolsize
private ConnectionDriver connectionDriver
private java.lang.String stdLogFilename
private java.io.Writer stdLog
private java.lang.String errorLogFilename
private java.io.Writer errorLog
private java.text.SimpleDateFormat logFormat
private boolean normalLogging
private static final long MAX_LOG_FILESIZE
private static final int MAX_BACKUP_INDEX
| Constructor Detail |
public ZetaServlet()
| Method Detail |
public java.lang.String getInitParameter(java.lang.String name)
getInitParameter in interface javax.servlet.ServletConfiggetInitParameter in class javax.servlet.GenericServletpublic java.util.Enumeration getInitParameterNames()
getInitParameterNames in interface javax.servlet.ServletConfiggetInitParameterNames in class javax.servlet.GenericServlet
public int getInitParameter(java.lang.String name,
int defaultValue)
public boolean hasSeparateFiles()
public void init()
throws javax.servlet.ServletException
init in class javax.servlet.GenericServletjavax.servlet.ServletExceptionpublic void destroy()
destroy in interface javax.servlet.Servletdestroy in class javax.servlet.GenericServlet
public java.sql.Connection getConnection()
throws javax.servlet.ServletException
javax.servlet.ServletExceptionpublic int getServerId()
public void setServerId(int serverId)
public int getNumberOfStatisticHandlers()
public java.lang.Class getStatisticHandlerClass(int i)
i - index
public java.lang.String getStatisticHandlerName(java.lang.Class handler)
handler - class of a statistic handler
public AbstractHandler getStatisticHandler(java.lang.Class handler)
handler - class of a statistic handler
public java.lang.String getHandlerAddress(java.lang.Class handler)
handler - class of a statistic handler
protected void doGet(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
throws javax.servlet.ServletException,
java.io.IOException
doGet in class javax.servlet.http.HttpServletreq - contains the request the client has made of the servlet.resp - contains the response the servlet sends to the client.
java.io.IOException - if an I/O error occurs when the servlet handles the GET request.
javax.servlet.ServletException - if the request for the GET could not be handled.HttpServlet.doGet(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
protected void doPost(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
throws javax.servlet.ServletException,
java.io.IOException
doPost in class javax.servlet.http.HttpServletreq - contains the request the client has made of the servlet.resp - contains the response the servlet sends to the client.
java.io.IOException - if an I/O error occurs when the servlet handles the POST request.
javax.servlet.ServletException - if the request for the POST could not be handled.HttpServlet.doPost(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
public void addStatisticHandler(java.lang.String name,
java.lang.String parameter,
java.util.List statisticHandlers)
throws java.lang.Exception
java.lang.Exceptionpublic void log(java.lang.String msg)
log in class javax.servlet.GenericServletpublic void log(java.lang.Throwable t)
private void initLogFile()
private void rollOver(java.lang.String filename,
int maxBackupIndex)
private java.lang.Object findHandler(java.util.List handlers,
java.lang.String name)
handlers - container with the handlername - name of the handler which is searched
private java.lang.Object getInstance(java.lang.Class handlerClass)
throws java.lang.Exception,
java.lang.Error
handlerClass - class of the handler
java.lang.Exception
java.lang.Error
|
ZetaGrid v1.9 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||