All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.purej.vminspect.html.HtmlPageView Maven / Gradle / Ivy

Go to download

An easy to use, feature-rich, JMX-based and embeddable Java VM monitoring tool with a web-based user-interface

There is a newer version: 2.1.1
Show newest version
// Copyright (c), 2013, adopus consulting GmbH Switzerland, all rights reserved.
package com.purej.vminspect.html;

import java.io.IOException;
import java.util.Date;

/**
 * Html page that renders a common header and footer and a custom part in between.
 *
 * @author Stefan Mueller
 */
public class HtmlPageView extends AbstractHtmlView {
  private final long _startTimestamp;
  private final String _reloadParameters;
  private final AbstractHtmlView _bodyView;

  /**
   * Creates a new instance of this view.
   */
  public HtmlPageView(StringBuilder output, String reloadParameters, long startTimestamp, AbstractHtmlView bodyView) {
    super(output);
    _reloadParameters = reloadParameters;
    _startTimestamp = startTimestamp;
    _bodyView = bodyView;
  }

  @Override
  public void render() throws IOException {
    writeHtmlHeader();
    _bodyView.render();
    writeHtmlFooter();
  }

  private void writeHtmlHeader() throws IOException {
    writeln("");
    writeln("");
    writeln("");
    writeln("PureJ VM Inspection");
    writeln("");
    writeln("");
    writeln("");
    writeln("");
    writeln("");
    writeln("");
    writeln("

PureJ VM Inspection " + lnk(_reloadParameters, img("icons/refresh-24.png", "Refresh")) + "

"); writeln("
"); } private void writeHtmlFooter() throws IOException { writeln("
"); writeln("Display date: " + formatDateTime(new Date(_startTimestamp)) + "
"); writeln("Display duration: " + formatNumber(System.currentTimeMillis() - _startTimestamp) + "ms
"); writeln("
"); writeln(""); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy