org.hippoecm.hst.servlet
Class HstPingServlet
java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
org.hippoecm.hst.servlet.HstPingServlet
- All Implemented Interfaces:
- Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig
public class HstPingServlet
- extends javax.servlet.http.HttpServlet
A servlet that can be used to check if the repository is up-and-running. This
is especially useful for load balancer checks. The check does the following steps:
- Check for static custom return message, else
- obtain the session from the specified session pool
- try to read the check node
- logout and close jcr session
- logout and close http session
On success the servlet prints "Ok" and returns a 200 status, on failure, the error is
printed and a 500 (internal server error) status is returned.
In case the custom message is provided, a service unavailable error (503) is returned
To enable the servlet add the following to your web.xml
HstPingServlet
org.hippoecm.repository.HstPingServlet
check-pool
default
check-node
content/documents
HstPingServlet
/ping/*
]]>
- See Also:
- Serialized Form
Method Summary |
protected void |
doGet(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
|
void |
init(javax.servlet.ServletConfig config)
|
Methods inherited from class javax.servlet.http.HttpServlet |
doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service |
Methods inherited from class javax.servlet.GenericServlet |
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HstPingServlet
public HstPingServlet()
init
public void init(javax.servlet.ServletConfig config)
throws javax.servlet.ServletException
- Specified by:
init
in interface javax.servlet.Servlet
- Overrides:
init
in class javax.servlet.GenericServlet
- Throws:
javax.servlet.ServletException
doGet
protected void doGet(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
throws javax.servlet.ServletException,
IOException
- Overrides:
doGet
in class javax.servlet.http.HttpServlet
- Throws:
javax.servlet.ServletException
IOException
Copyright © 2008-2012 Hippo. All Rights Reserved.