Package net.myrrix.web

Source Code of net.myrrix.web.status_jspx

/*
* Generated by the Jasper component of Apache Tomcat
* Version: JspCServletContext/1.0
* Generated at: 2013-09-07 23:30:58 UTC
* Note: The last modified time of this file was set to
*       the last modified time of the source file after
*       generation to assist with modification tracking.
*/
package net.myrrix.web;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import java.util.List;
import net.myrrix.common.stats.JVMEnvironment;
import net.myrrix.web.servlets.AbstractMyrrixServlet;
import net.myrrix.common.ReloadingReference;
import com.google.common.net.HostAndPort;
import java.util.concurrent.TimeUnit;

public final class status_jspx extends org.apache.jasper.runtime.HttpJspBase
    implements org.apache.jasper.runtime.JspSourceDependent {

  private static final javax.servlet.jsp.JspFactory _jspxFactory =
          javax.servlet.jsp.JspFactory.getDefaultFactory();

  private static java.util.Map<java.lang.String,java.lang.Long> _jspx_dependants;

  private javax.el.ExpressionFactory _el_expressionfactory;
  private org.apache.tomcat.InstanceManager _jsp_instancemanager;

  public java.util.Map<java.lang.String,java.lang.Long> getDependants() {
    return _jspx_dependants;
  }

  public void _jspInit() {
    _el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();
    _jsp_instancemanager = org.apache.jasper.runtime.InstanceManagerFactory.getInstanceManager(getServletConfig());
  }

  public void _jspDestroy() {
  }

  public void _jspService(final javax.servlet.http.HttpServletRequest request, final javax.servlet.http.HttpServletResponse response)
        throws java.io.IOException, javax.servlet.ServletException {

    final javax.servlet.jsp.PageContext pageContext;
    final javax.servlet.ServletContext application;
    final javax.servlet.ServletConfig config;
    javax.servlet.jsp.JspWriter out = null;
    final java.lang.Object page = this;
    javax.servlet.jsp.JspWriter _jspx_out = null;
    javax.servlet.jsp.PageContext _jspx_page_context = null;


    try {
      response.setContentType("application/xml;charset=UTF-8");
      pageContext = _jspxFactory.getPageContext(this, request, response,
            null, false, 8192, true);
      _jspx_page_context = pageContext;
      application = pageContext.getServletContext();
      config = pageContext.getServletConfig();
      out = pageContext.getOut();
      _jspx_out = out;

      out.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");

pageContext.setAttribute("jvmEnv", new JVMEnvironment());
pageContext.setAttribute("rec", application.getAttribute(AbstractMyrrixServlet.RECOMMENDER_KEY));

      out.write("<status>");
      out.write("<machine>");
      out.write("<maxMemory>");
      out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${jvmEnv.maxMemory}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null, false));
      out.write("</maxMemory>");
      out.write("<usedMemory>");
      out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${jvmEnv.usedMemory}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null, false));
      out.write("</usedMemory>");
      out.write("<cores>");
      out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${jvmEnv.numProcessors}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null, false));
      out.write("</cores>");
      out.write("</machine>");
      out.write("<configuration>");
      out.write("<instanceID>");
      out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${rec.instanceID}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null, false));
      out.write("</instanceID>");
      out.write("</configuration>");
      out.write("<recommender>");
      out.write("<ready>");
      out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${rec.ready}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null, false));
      out.write("</ready>");
      out.write("<users>");
      out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${rec.generationManager.currentGeneration.numUsers}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null, false));
      out.write("</users>");
      out.write("<items>");
      out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${rec.generationManager.currentGeneration.numItems}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null, false));
      out.write("</items>");
      out.write("</recommender>");

    // Just looks awful doesn't it?
    @SuppressWarnings("unchecked")
    ReloadingReference<List<List<HostAndPort>>> ref =
      (ReloadingReference<List<List<HostAndPort>>>)
          application.getAttribute(AbstractMyrrixServlet.ALL_PARTITIONS_REF_KEY);
    if (ref != null) {
 
      out.write("<cluster>");

      pageContext.setAttribute("thisPartition", application.getAttribute(AbstractMyrrixServlet.PARTITION_KEY));
      int partitionNumber = 0;
      for (Iterable<HostAndPort> partition : ref.get(1, TimeUnit.SECONDS)) {
        pageContext.setAttribute("partitionNumber", partitionNumber);
   
      out.write("<partitionNumber>");
      out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${thisPartition}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null, false));
      out.write("</partitionNumber>");
      out.write("<partition>");
      out.write("<number>");
      out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${partitionNumber}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null, false));
      out.write("</number>");

        for (HostAndPort replica : partition) {
          pageContext.setAttribute("replica", replica);
     
      out.write("<replica>");
      out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${replica.hostText}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null, false));
      out.write(':');
      out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${replica.port}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null, false));
      out.write("</replica>");

        }
     
      out.write("</partition>");

        partitionNumber++;
      }
   
      out.write("</cluster>");

    }
 
      out.write("</status>");
    } catch (java.lang.Throwable t) {
      if (!(t instanceof javax.servlet.jsp.SkipPageException)){
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0)
          try { out.clearBuffer(); } catch (java.io.IOException e) {}
        if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
        else throw new ServletException(t);
      }
    } finally {
      _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
}
TOP

Related Classes of net.myrrix.web.status_jspx

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.