001/*
002 *  This file is part of the Jikes RVM project (http://jikesrvm.org).
003 *
004 *  This file is licensed to You under the Eclipse Public License (EPL);
005 *  You may not use this file except in compliance with the License. You
006 *  may obtain a copy of the License at
007 *
008 *      http://www.opensource.org/licenses/eclipse-1.0.php
009 *
010 *  See the COPYRIGHT.txt file distributed with this work for information
011 *  regarding copyright ownership.
012 */
013package org.jikesrvm;
014
015import org.jikesrvm.mm.mminterface.Selected;
016import org.jikesrvm.runtime.CommandLineArgs;
017import org.jikesrvm.runtime.Time;
018
019/**
020 * Support class for implementations of the JMX runtime beans.
021 */
022public class JMXSupport {
023
024  public static String[] getInputArguments() {
025    return CommandLineArgs.getInputArgs();
026  }
027
028  public static String getName() {
029    StringBuilder name = new StringBuilder();
030    if (VM.BuildFor32Addr) {
031      name.append("32");
032    } else {
033      name.append("64");
034    }
035    name.append(" bit Jikes RVM using ");
036    if (VM.BuildForGnuClasspath) {
037      name.append("GNU Classpath");
038    } else if (VM.BuildForHarmony) {
039      name.append("Apache Harmony");
040    }
041    if (VM.BuildForIA32) {
042      name.append(" on IA32");
043    } else if (VM.BuildForPowerPC) {
044      name.append(" on PowerPC");
045    }
046    if (VM.BuildForAdaptiveSystem) {
047      name.append(" (Adaptive Optimization System and Opt Compiler");
048    } else {
049      name.append(" (Baseline Compiler");
050    }
051    name.append(", garbage collection plan: ");
052    name.append(Selected.name);
053    name.append(")");
054    return name.toString();
055  }
056
057  public static long getStartTime() {
058    return Time.bootTime();
059  }
060
061}