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

com.purej.vminspect.html.MBeansMainView 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.List;
import com.purej.vminspect.data.MBeanName;
import com.purej.vminspect.util.Utils;

/**
 * Displays the MBeans main view.
 *
 * @author Stefan Mueller
 */
public class MBeansMainView extends AbstractMBeansView {
  private final String _domainFilter;
  private final String _typeFilter;
  private final List _mbeans;

  /**
   * Creates a new instance of this view.
   */
  public MBeansMainView(StringBuilder output, String domainFilter, String typeFilter, List mbeans) {
    super(output);
    _domainFilter = domainFilter != null ? domainFilter : "";
    _typeFilter = typeFilter != null ? typeFilter : "";
    _mbeans = mbeans;
  }

  @Override
  public void render() throws IOException {
    writeln("

" + img("icons/beans-24.png", "MBeans") + " MBeans

"); // Write the filter row: writeln("
"); writeln("
 Domain Filter  "); writeln(""); writeln("  Type Filter  "); writeln(""); writeln("  (Use wild cards = *)     "); writeln("

"); writeln(""); writeln("

"); // Write the table: CandyHtmlTable table = new CandyHtmlTable("MBeans", "Domain", "Type", "Properties", "Details"); int filterMatchingCount = 0; for (MBeanName mbean : _mbeans) { if (!Utils.wildCardMatch(mbean.getDomain(), _domainFilter)) { continue; } if (!Utils.wildCardMatch(mbean.getType(), _typeFilter)) { continue; } filterMatchingCount++; table.nextRow(); table.addValue(mbean.getDomain()); table.addValue(htmlEncode(mbean.getType())); table.addValue(htmlEncode(mbean.getOtherKeyValues())); table.addValueCenter(mBeanLnk(mbean.getServerIdx(), mbean.getObjectName(), img("icons/bean-view-16.png", "Details"))); } table.endTable(); writeln("Filter matched " + filterMatchingCount + "/" + _mbeans.size() + " MBeans
"); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy