com.purej.vminspect.html.HtmlPageView Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of purej-vminspect Show documentation
Show all versions of purej-vminspect Show documentation
An easy to use, feature-rich, JMX-based and embeddable Java VM monitoring tool with a web-based user-interface
// 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