class StagemonitorMetricsServlet extends HttpServlet {

	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		resp.setContentType("application/json");
		if (servletPlugin.getMetricsServletAllowedOrigin() != null) {
			resp.setHeader("Access-Control-Allow-Origin", servletPlugin.getMetricsServletAllowedOrigin());
		}
		resp.setHeader("Cache-Control", "must-revalidate,no-cache,no-store");
		resp.setStatus(HttpServletResponse.SC_OK);

		try (OutputStream output = resp.getOutputStream()) {
			String jsonpParamName = servletPlugin.getMetricsServletJsonpParamName();
			if (jsonpParamName != null && req.getParameter(jsonpParamName) != null) {
				getWriter(req).writeValue(output, new JSONPObject(req.getParameter(jsonpParamName), registry));
			} else {
				getWriter(req).writeValue(output, registry);
			}
		}
	}

	public  StagemonitorMetricsServlet();
	public  StagemonitorMetricsServlet(Metric2Registry registry, ServletPlugin servletPlugin, ObjectMapper mapper);

}