|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.servlet.GenericServlet
javax.servlet.http.HttpServlet
org.mmbase.servlet.MMBaseServlet
public class MMBaseServlet
MMBaseServlet is a base class for other MMBase servlets (like ImageServlet). Its main goal is to store a MMBase instance for all its descendants, but it can also be used as a serlvet itself, to show MMBase version information.
| Field Summary | |
|---|---|
protected MMBase |
mmbase
MMBase reference. |
protected int |
retryAfter
If MMBase has not been started, a 503 is given, with this value for the 'Retry-After' header. |
| Constructor Summary | |
|---|---|
MMBaseServlet()
|
|
| Method Summary | |
|---|---|
protected static void |
associateMapping(String function,
String servletMapping,
Integer priority)
Associate a given servletmapping with the given function. |
protected boolean |
checkInited(HttpServletResponse res)
This methods can be (and is) called in the beginning of service. |
protected void |
decRefCount(HttpServletRequest req)
Decrease the reference count of the servlet |
void |
destroy()
|
protected void |
doGet(HttpServletRequest req,
HttpServletResponse res)
Serves MMBase version information. |
protected Map<String,Integer> |
getAssociations()
On default, servlets are not associated with any function. |
static String |
getBasePath(String function)
|
MMBase |
getMMBase()
Returns the MMBase instance. |
protected static String |
getRequestURL(HttpServletRequest req)
Return URI with QueryString appended |
static String |
getServletByAssociation(String function)
Gets the name of the servlet that performs actions associated with the the given function. |
static HttpServlet |
getServletByMapping(String mapping)
Gets the servlet that belongs to the given mapping |
String |
getServletInfo()
Returns information about this servlet. |
static List<String> |
getServletMappings(String servletName)
Gets all the mappings for a given servlet. |
static List<String> |
getServletMappingsByAssociation(String function)
Gets all the mappings for a given association. |
protected void |
incRefCount(HttpServletRequest req)
Increase the reference count of the servlet (for debugging) and send running servlets to log once every 32 requests |
void |
init()
The init of an MMBaseServlet checks if MMBase is running. |
void |
service(HttpServletRequest req,
HttpServletResponse res)
The service method is extended with calls for the refCount functionality (for performance related debugging). |
void |
setInitException(ServletException e)
Called by MMBaseStartThread, if something went wrong during initialization of MMBase. |
void |
setMMBase(MMBase mmb)
Sets the mmbase member. |
| Methods inherited from class javax.servlet.http.HttpServlet |
|---|
doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service |
| Methods inherited from class javax.servlet.GenericServlet |
|---|
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletName, init, log, log |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected MMBase mmbase
protected int retryAfter
| Constructor Detail |
|---|
public MMBaseServlet()
| Method Detail |
|---|
protected Map<String,Integer> getAssociations()
public MMBase getMMBase()
getMMBase in interface MMBaseStarterpublic void setMMBase(MMBase mmb)
setMMBase in interface MMBaseStarterpublic void setInitException(ServletException e)
setInitException in interface MMBaseStarter
public void init()
throws ServletException
init in class GenericServletServletExceptionpublic static HttpServlet getServletByMapping(String mapping)
mapping - the mapping used to access the servlet
public static List<String> getServletMappings(String servletName)
servletName - the name of the servlet
public static List<String> getServletMappingsByAssociation(String function)
function - the function that identifies the type of association
public static String getServletByAssociation(String function)
function - the function that identifies the type of association
public static String getBasePath(String function)
protected static void associateMapping(String function,
String servletMapping,
Integer priority)
function - the function that identifies the type of associationservletMapping - mapping of the servlet to associate with the functionpriority - priority of this association, the association only occurs if no servlet or servletmapping
with higher priority for the same function is present already
protected void doGet(HttpServletRequest req,
HttpServletResponse res)
throws ServletException,
IOException
doGet in class HttpServletServletException
IOException
protected boolean checkInited(HttpServletResponse res)
throws ServletException,
IOException
ServletException
IOException
public void service(HttpServletRequest req,
HttpServletResponse res)
throws ServletException,
IOException
service in class HttpServletServletException
IOExceptionpublic String getServletInfo()
getServletInfo in interface ServletgetServletInfo in class GenericServletprotected static String getRequestURL(HttpServletRequest req)
req - The HttpServletRequest.protected void decRefCount(HttpServletRequest req)
req - The HttpServletRequest.protected void incRefCount(HttpServletRequest req)
req - The HttpServletRequest.public void destroy()
destroy in interface Servletdestroy in class GenericServlet
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||