com-sun-tools-visualvm-sa

16:34:01.413 INFO  jd.cli.Main - Decompiling com-sun-tools-visualvm-sa.jar
package com.sun.tools.visualvm.sa;

import java.io.File;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.MalformedURLException;
import java.util.HashMap;
import java.util.Map;

class Agent
{
  private static Map<File, Agent> agentMap = new HashMap();
  private SAWrapper saClassLoader;
  private final SAObject bugspotAgent;
  private VM vm;
  private Arguments args;
  
  static Agent getAgent(File jdkHome, File saJarFile)
    throws ClassNotFoundException, InstantiationException, IllegalAccessException, MalformedURLException
  {
    synchronized (agentMap)
    {
      Agent agent = (Agent)agentMap.get(saJarFile);
      if (agent == null)
      {
        agent = new Agent(jdkHome, saJarFile);
        agentMap.put(saJarFile, agent);
      }
      return agent;
    }
  }
  
  private Agent(File jdkHome, File saJarFile)
    throws ClassNotFoundException, InstantiationException, IllegalAccessException, MalformedURLException
  {
    saClassLoader = new SAWrapper(jdkHome, saJarFile);
    bugspotAgent = new SAObject(saClassLoader.BugspotAgent().newInstance());
  }
  
  boolean attach(int pid)
    throws ClassNotFoundException, InstantiationException, IllegalAccessException, InvocationTargetException
  {
    bugspotAgent.invoke("attach", new Object[] { Integer.valueOf(pid) });
    return isJavaMode();
  }
  
  boolean attach(String executable, String coredump)
    throws ClassNotFoundException, InstantiationException, IllegalAccessException, InvocationTargetException
  {
    bugspotAgent.invoke("attach", new Object[] { executable, coredump });
    return isJavaMode();
  }
  
  boolean attach(String remoteServer)
    throws ClassNotFoundException, InstantiationException, IllegalAccessException, InvocationTargetException
  {
    bugspotAgent.invoke("attach", new Object[] { remoteServer });
    return isJavaMode();
  }
  
  void detach()
    throws IllegalAccessException, InvocationTargetException
  {
    bugspotAgent.invoke("detach", new Object[0]);
  }
  
  VM getVM()
    throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException
  {
    if (vm == null)
    {
      Class vmClass = saClassLoader.VM();
      Object saVM = vmClass.getMethod("getVM", new Class[0]).invoke(null, new Object[0]);
      vm = new VM(saVM);
    }
    return vm;
  }
  
  Arguments getArguments()
    throws ClassNotFoundException
  {
    if (args == null) {
      args = new Arguments(saClassLoader.Arguments());
    }
    return args;
  }
  
  SAObject getHeapHprofBinWriter()
    throws ClassNotFoundException, InstantiationException, IllegalAccessException
  {
    return new SAObject(saClassLoader.HeapHprofBinWriter().newInstance());
  }
  
  private boolean isJavaMode()
    throws IllegalAccessException, InvocationTargetException
  {
    Boolean b = (Boolean)bugspotAgent.invoke("isJavaMode", new Object[0]);
    return b.booleanValue();
  }
}

/* Location:
 * Qualified Name:     com.sun.tools.visualvm.sa.Agent
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.tools.visualvm.sa;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

class Arguments
{
  private final Class arguments;
  
  Arguments(Class args)
  {
    arguments = args;
  }
  
  String getJVMFlags()
    throws NoSuchMethodException, IllegalAccessException, InvocationTargetException
  {
    return (String)arguments.getMethod("getJVMFlags", new Class[0]).invoke(null, new Object[0]);
  }
  
  String getJVMArgs()
    throws NoSuchMethodException, IllegalAccessException, InvocationTargetException
  {
    return (String)arguments.getMethod("getJVMArgs", new Class[0]).invoke(null, new Object[0]);
  }
  
  String getJavaCommand()
    throws NoSuchMethodException, IllegalAccessException, InvocationTargetException
  {
    return (String)arguments.getMethod("getJavaCommand", new Class[0]).invoke(null, new Object[0]);
  }
}

/* Location:
 * Qualified Name:     com.sun.tools.visualvm.sa.Arguments
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.tools.visualvm.sa;

import com.sun.tools.visualvm.tools.sa.SaModelFactory;
import org.openide.modules.ModuleInstall;

public class Installer
  extends ModuleInstall
{
  public void restored()
  {
    SaModelFactory.getDefault().registerProvider(new SaModelProvider());
  }
}

/* Location:
 * Qualified Name:     com.sun.tools.visualvm.sa.Installer
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.tools.visualvm.sa;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

class SAObject
{
  final Object instance;
  Map<String, List<Method>> methodCache;
  private static Map<Class, Class> primitiveTypes = new HashMap();
  
  static
  {
    primitiveTypes.put(Integer.class, Integer.TYPE);
  }
  
  SAObject(Object i)
  {
    instance = i;
    if (i != null)
    {
      methodCache = new HashMap();
      Method[] methods = i.getClass().getMethods();
      for (int j = 0; j < methods.length; j++)
      {
        Method method = methods[j];
        String name = method.getName();
        int pars = method.getParameterTypes().length;
        String id = methodId(name, pars);
        List<Method> mlist = Collections.singletonList(method);
        List<Method> oldlist = (List)methodCache.put(id, mlist);
        if (oldlist != null)
        {
          List<Method> unitedList = new ArrayList(mlist);
          unitedList.addAll(oldlist);
          methodCache.put(id, unitedList);
        }
      }
    }
  }
  
  boolean isNull()
  {
    return instance == null;
  }
  
  Object invoke(String methodName, Object... parameters)
    throws IllegalAccessException, InvocationTargetException
  {
    String mid = methodId(methodName, parameters.length);
    List<Method> methods = (List)methodCache.get(mid);
    Method method = null;
    if (methods == null) {
      throw new IllegalAccessException("No method " + mid);
    }
    Class[] parClasses;
    if (methods.size() == 1)
    {
      method = (Method)methods.get(0);
    }
    else
    {
      parClasses = new Class[parameters.length];
      for (int i = 0; i < parameters.length; i++)
      {
        Class cl = parameters[i].getClass();
        if (primitiveTypes.containsKey(cl)) {
          cl = (Class)primitiveTypes.get(cl);
        }
        parClasses[i] = cl;
      }
      for (Method m : methods) {
        if (Arrays.deepEquals(m.getParameterTypes(), parClasses))
        {
          method = m;
          break;
        }
      }
    }
    if (method == null) {
      throw new IllegalArgumentException(instance + " " + methodName + " " + Arrays.toString(parameters));
    }
    return method.invoke(instance, parameters);
  }
  
  SAObject invokeSA(String methodName, Object... parameters)
    throws IllegalAccessException, InvocationTargetException
  {
    return new SAObject(invoke(methodName, parameters));
  }
  
  private static String methodId(String name, int pars)
  {
    return name.concat("#").concat(Integer.toString(pars));
  }
  
  public String toString()
  {
    if (instance != null) {
      return instance.toString();
    }
    return "<null>";
  }
  
  public int hashCode()
  {
    if (instance == null) {
      return 0;
    }
    return instance.hashCode();
  }
  
  public boolean equals(Object obj)
  {
    if ((obj instanceof SAObject))
    {
      SAObject saobj = (SAObject)obj;
      if (instance == null) {
        return instance == null;
      }
      return instance.equals(instance);
    }
    return false;
  }
}

/* Location:
 * Qualified Name:     com.sun.tools.visualvm.sa.SAObject
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.tools.visualvm.sa;

import java.io.File;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.logging.Logger;

class SAWrapper$1
  extends URLClassLoader
{
  SAWrapper$1(SAWrapper paramSAWrapper, URL[] x0)
  {
    super(x0);
  }
  
  protected String findLibrary(String libname)
  {
    String name = System.mapLibraryName(libname);
    File library = new File(this$0.libraryPath, name);
    SAWrapper.access$000().fine("Library " + library.getAbsolutePath());
    if ((library.exists()) && (library.canRead())) {
      return library.getAbsolutePath();
    }
    return super.findLibrary(libname);
  }
}

/* Location:
 * Qualified Name:     com.sun.tools.visualvm.sa.SAWrapper.1
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.tools.visualvm.sa;

import java.io.File;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.logging.Logger;

class SAWrapper
{
  private static final Logger LOGGER = Logger.getLogger(SAWrapper.class.getName());
  URLClassLoader loader;
  File libraryPath;
  
  SAWrapper(File jdkHome, File saJarFile)
    throws MalformedURLException
  {
    System.setProperty("sun.jvm.hotspot.debugger.useProcDebugger", "true");
    System.setProperty("sun.jvm.hotspot.debugger.useWindbgDebugger", "true");
    URL[] saJarUrls = { saJarFile.toURI().toURL() };
    String osArch = System.getProperty("os.arch");
    if ("x86".equals(osArch)) {
      osArch = "i386";
    }
    libraryPath = new File(jdkHome, "jre/lib/" + osArch);
    LOGGER.fine("Path " + libraryPath.getAbsolutePath());
    loader = new URLClassLoader(saJarUrls)
    {
      protected String findLibrary(String libname)
      {
        String name = System.mapLibraryName(libname);
        File library = new File(libraryPath, name);
        SAWrapper.LOGGER.fine("Library " + library.getAbsolutePath());
        if ((library.exists()) && (library.canRead())) {
          return library.getAbsolutePath();
        }
        return super.findLibrary(libname);
      }
    };
  }
  
  Class classForName(String name)
    throws ClassNotFoundException
  {
    return Class.forName(name, true, loader);
  }
  
  Class Tool()
    throws ClassNotFoundException
  {
    return classForName("sun.jvm.hotspot.tools.Tool");
  }
  
  Class VM()
    throws ClassNotFoundException
  {
    return classForName("sun.jvm.hotspot.runtime.VM");
  }
  
  Class BugspotAgent()
    throws ClassNotFoundException
  {
    return classForName("sun.jvm.hotspot.bugspot.BugSpotAgent");
  }
  
  Class HeapHprofBinWriter()
    throws ClassNotFoundException
  {
    return classForName("sun.jvm.hotspot.utilities.HeapHprofBinWriter");
  }
  
  Class Arguments()
    throws ClassNotFoundException
  {
    return classForName("sun.jvm.hotspot.runtime.Arguments");
  }
}

/* Location:
 * Qualified Name:     com.sun.tools.visualvm.sa.SAWrapper
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.tools.visualvm.sa;

import com.sun.tools.visualvm.tools.sa.SaModel;
import java.io.File;
import java.lang.reflect.InvocationTargetException;
import java.net.MalformedURLException;
import java.util.Properties;
import org.openide.ErrorManager;

public class SaModelImpl
  extends SaModel
{
  private Agent agent;
  private int pid;
  String executable;
  String core;
  private Properties sysProp;
  private String jvmFlags;
  private String jvmArgs;
  private String commandLine;
  
  SaModelImpl(File jdkHome, File sajar, int id)
    throws ClassNotFoundException, InstantiationException, IllegalAccessException, MalformedURLException, InvocationTargetException, NoSuchMethodException
  {
    agent = Agent.getAgent(jdkHome, sajar);
    pid = id;
    readData();
  }
  
  SaModelImpl(File jdkHome, File sajar, File execFile, File coreFile)
    throws ClassNotFoundException, InstantiationException, IllegalAccessException, InvocationTargetException, MalformedURLException, NoSuchMethodException
  {
    agent = Agent.getAgent(jdkHome, sajar);
    executable = execFile.getAbsolutePath();
    core = coreFile.getAbsolutePath();
    readData();
  }
  
  public Properties getSystemProperties()
  {
    return sysProp;
  }
  
  public boolean takeHeapDump(String file)
  {
    try
    {
      synchronized (agent)
      {
        try
        {
          if (attach())
          {
            SAObject hprofWrite = agent.getHeapHprofBinWriter();
            hprofWrite.invoke("write", new Object[] { file });
            boolean bool = true;
            
            agent.detach();return bool;
          }
        }
        finally
        {
          agent.detach();
        }
      }
    }
    catch (Exception ex)
    {
      Throwable e = ex.getCause();
      ErrorManager.getDefault().notify(e == null ? ex : e);
    }
    return false;
  }
  
  public String takeThreadDump()
  {
    try
    {
      synchronized (agent)
      {
        try
        {
          if (attach())
          {
            String str = new StackTrace(agent.getVM()).getStackTrace();
            
            agent.detach();return str;
          }
        }
        finally
        {
          agent.detach();
        }
      }
    }
    catch (Exception ex)
    {
      Throwable e = ex.getCause();
      ErrorManager.getDefault().notify(e == null ? ex : e);
    }
    return null;
  }
  
  public String getJvmFlags()
  {
    return jvmFlags;
  }
  
  public String getJvmArgs()
  {
    return jvmArgs;
  }
  
  public String getJavaCommand()
  {
    return commandLine;
  }
  
  private boolean attach()
    throws ClassNotFoundException, InstantiationException, IllegalAccessException, InvocationTargetException
  {
    if (core == null) {
      return agent.attach(pid);
    }
    return agent.attach(executable, core);
  }
  
  private void readData()
    throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException
  {
    synchronized (agent)
    {
      try
      {
        if (attach())
        {
          Arguments args = agent.getArguments();
          jvmFlags = args.getJVMFlags();
          jvmArgs = args.getJVMArgs();
          commandLine = args.getJavaCommand();
          sysProp = ((Properties)agent.getVM().getSystemProperties().clone());
        }
      }
      finally
      {
        agent.detach();
      }
    }
  }
}

/* Location:
 * Qualified Name:     com.sun.tools.visualvm.sa.SaModelImpl
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.tools.visualvm.sa;

import com.sun.tools.visualvm.application.Application;
import com.sun.tools.visualvm.core.datasource.DataSource;
import com.sun.tools.visualvm.core.model.AbstractModelProvider;
import com.sun.tools.visualvm.coredump.CoreDump;
import com.sun.tools.visualvm.host.Host;
import com.sun.tools.visualvm.tools.jvmstat.JvmJvmstatModel;
import com.sun.tools.visualvm.tools.jvmstat.JvmJvmstatModelFactory;
import com.sun.tools.visualvm.tools.sa.SaModel;
import java.io.File;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;

public class SaModelProvider
  extends AbstractModelProvider<SaModel, DataSource>
{
  private static final Logger LOGGER = Logger.getLogger(SaModelProvider.class.getName());
  private static final String SA_JAR = "lib/sa-jdi.jar";
  
  public SaModel createModelFor(DataSource ds)
  {
    if ((ds instanceof Application))
    {
      Application app = (Application)ds;
      if (Host.LOCALHOST.equals(app.getHost()))
      {
        JvmJvmstatModel jvmstat = JvmJvmstatModelFactory.getJvmstatModelFor(app);
        File jdkHome = getJdkHome(jvmstat);
        File saJar = getSaJar(jdkHome);
        if (saJar == null) {
          return null;
        }
        try
        {
          return new SaModelImpl(jdkHome, saJar, app.getPid());
        }
        catch (Exception ex)
        {
          LOGGER.log(Level.INFO, "Error getting SA agent", ex);
          
          return null;
        }
      }
    }
    else if ((ds instanceof CoreDump))
    {
      CoreDump coredump = (CoreDump)ds;
      File executable = new File(coredump.getExecutable());
      File coreFile = coredump.getFile();
      if ((executable.exists()) && (coreFile.exists()))
      {
        File jdkHome = executable.getParentFile().getParentFile();
        File saJar = getSaJar(jdkHome);
        if (saJar == null) {
          return null;
        }
        try
        {
          return new SaModelImpl(jdkHome, saJar, executable, coreFile);
        }
        catch (Exception ex)
        {
          LOGGER.log(Level.INFO, "Unable to retrieve SA agent", ex);
          
          return null;
        }
      }
    }
    return null;
  }
  
  private File getJdkHome(JvmJvmstatModel jvmstat)
  {
    File jdkHome = new File(jvmstat.getJavaHome());
    if ("jre".equals(jdkHome.getName())) {
      jdkHome = jdkHome.getParentFile();
    }
    return jdkHome;
  }
  
  static File getSaJar(File jdkHome)
  {
    File saJar = new File(jdkHome, "lib/sa-jdi.jar");
    try
    {
      if (saJar.exists()) {
        return saJar.getCanonicalFile();
      }
    }
    catch (IOException ex)
    {
      LOGGER.log(Level.INFO, saJar.getPath(), ex);
    }
    return null;
  }
}

/* Location:
 * Qualified Name:     com.sun.tools.visualvm.sa.SaModelProvider
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.tools.visualvm.sa;

import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import java.lang.reflect.InvocationTargetException;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;

class StackTrace
{
  private VM vm;
  private SAObject heap;
  private SAObject objectClass;
  
  StackTrace(VM v)
    throws IllegalAccessException, InvocationTargetException
  {
    vm = v;
    heap = vm.getObjectHeap();
    objectClass = vm.getSystemDictionary().invokeSA("getObjectKlass", new Object[0]);
  }
  
  public String getStackTrace()
    throws IllegalAccessException, InvocationTargetException
  {
    ByteArrayOutputStream data = new ByteArrayOutputStream(4096);
    PrintStream out = new PrintStream(data);
    SAObject threads = vm.getThreads();
    for (SAObject curThread = threads.invokeSA("first", new Object[0]); !curThread.isNull(); curThread = curThread.invokeSA("next", new Object[0]))
    {
      try
      {
        Boolean isJavaThread = (Boolean)curThread.invoke("isJavaThread", new Object[0]);
        if (!isJavaThread.booleanValue()) {
          out.print("VM ");
        }
        out.print("Thread ");
        curThread.invoke("printThreadIDOn", new Object[] { out });
        out.print(" \"" + curThread.invoke("getThreadName", new Object[0]) + "\"");
        out.print(": (state = ");
        out.print(curThread.invoke("getThreadState", new Object[0]));
        out.println(")");
        if (isJavaThread.booleanValue())
        {
          SAObject javaFrame = curThread.invokeSA("getLastJavaVFrameDbg", new Object[0]);
          Object waitingToLockMonitor = curThread.invoke("getCurrentPendingMonitor", new Object[0]);
          boolean objectWaitFrame = isJavaLangObjectWaitFrame(javaFrame);
          for (; !javaFrame.isNull(); javaFrame = javaFrame.invokeSA("javaSender", new Object[0]))
          {
            printJavaFrame(out, javaFrame);
            printMonitors(out, javaFrame, waitingToLockMonitor, objectWaitFrame);
            waitingToLockMonitor = null;
            objectWaitFrame = false;
          }
        }
      }
      catch (Exception ex)
      {
        out.println("\t-- Error occurred during stack walking");
        Logger.getLogger(StackTrace.class.getName()).log(Level.INFO, "getStackTrace", ex);
      }
      out.println();
    }
    return data.toString();
  }
  
  private boolean isJavaLangObjectWaitFrame(SAObject javaFrame)
    throws IllegalAccessException, InvocationTargetException
  {
    if (!javaFrame.isNull())
    {
      SAObject method = javaFrame.invokeSA("getMethod", new Object[0]);
      SAObject klass = method.invokeSA("getMethodHolder", new Object[0]);
      Boolean isNative = (Boolean)method.invoke("isNative", new Object[0]);
      if ((objectClass.equals(klass)) && (isNative.booleanValue()) && 
        ("wait".equals(method.invokeSA("getName", new Object[0]).invoke("asString", new Object[0])))) {
        return true;
      }
    }
    return false;
  }
  
  private void printMonitors(PrintStream out, SAObject javaFrame, Object waitingToLockMonitor, boolean objectWaitFrame)
    throws IllegalAccessException, InvocationTargetException
  {
    if (objectWaitFrame)
    {
      SAObject stackValueCollection = javaFrame.invokeSA("getLocals", new Object[0]);
      Boolean isEmpty = (Boolean)stackValueCollection.invoke("isEmpty", new Object[0]);
      if (!isEmpty.booleanValue())
      {
        Object oopHandle = stackValueCollection.invoke("oopHandleAt", new Object[] { Integer.valueOf(0) });
        printMonitor(out, oopHandle, "waiting on");
      }
    }
    try
    {
      List mList = (List)javaFrame.invoke("getMonitors", new Object[0]);
      Object[] monitors = mList.toArray();
      for (int i = monitors.length - 1; i >= 0; i--)
      {
        SAObject monitorInfo = new SAObject(monitors[i]);
        Object ownerHandle = monitorInfo.invoke("owner", new Object[0]);
        if (ownerHandle != null)
        {
          String state = "locked";
          if (waitingToLockMonitor != null)
          {
            Object objectHandle = new SAObject(waitingToLockMonitor).invoke("object", new Object[0]);
            if (objectHandle.equals(ownerHandle)) {
              state = "waiting to lock";
            }
          }
          printMonitor(out, ownerHandle, state);
        }
      }
    }
    catch (Exception e) {}
  }
  
  private void printMonitor(PrintStream out, Object ownerHandle, String state)
  {
    try
    {
      StringBuilder sb = new StringBuilder();
      sb.append("\t- " + state + " <" + ownerHandle + "> ");
      printOop(sb, ownerHandle);
      out.println(sb.toString());
    }
    catch (Exception e) {}
  }
  
  private void printOop(StringBuilder sb, Object oopHandle)
    throws IllegalAccessException, InvocationTargetException
  {
    SAObject oop = heap.invokeSA("newOop", new Object[] { oopHandle });
    if (!oop.isNull())
    {
      sb.append("(a ");
      String monitorClassName = (String)oop.invokeSA("getKlass", new Object[0]).invokeSA("getName", new Object[0]).invoke("asString", new Object[0]);
      sb.append(monitorClassName.replace('/', '.'));
      sb.append(")");
    }
    else
    {
      sb.append("(Raw Monitor)");
    }
  }
  
  private void printJavaFrame(PrintStream out, SAObject javaFrame)
    throws IllegalAccessException, InvocationTargetException
  {
    SAObject method = javaFrame.invokeSA("getMethod", new Object[0]);
    
    out.print("\tat ");
    SAObject klass = method.invokeSA("getMethodHolder", new Object[0]);
    String className = (String)klass.invokeSA("getName", new Object[0]).invoke("asString", new Object[0]);
    out.print(className.replace('/', '.'));
    out.print(".");
    out.print(method.invokeSA("getName", new Object[0]).invoke("asString", new Object[0]));
    Integer bci = (Integer)javaFrame.invoke("getBCI", new Object[0]);
    out.print("(");
    if (((Boolean)method.invoke("isNative", new Object[0])).booleanValue())
    {
      out.print("Native Method");
    }
    else
    {
      Integer lineNumber = (Integer)method.invoke("getLineNumberFromBCI", new Object[] { bci });
      SAObject sourceName = klass.invokeSA("getSourceFileName", new Object[0]);
      if ((lineNumber.intValue() != -1) && (!sourceName.isNull()))
      {
        out.print(sourceName.invoke("asString", new Object[0]));
        out.print(":");
        out.print(lineNumber);
      }
      else
      {
        out.print("bci=");
        out.print(bci);
      }
    }
    out.println(")");
  }
}

/* Location:
 * Qualified Name:     com.sun.tools.visualvm.sa.StackTrace
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.tools.visualvm.sa;

import java.lang.reflect.InvocationTargetException;
import java.util.Properties;

class VM
{
  private final SAObject vm;
  
  VM(Object saVM)
  {
    vm = new SAObject(saVM);
  }
  
  Properties getSystemProperties()
    throws IllegalAccessException, InvocationTargetException
  {
    return (Properties)vm.invoke("getSystemProperties", new Object[0]);
  }
  
  SAObject getThreads()
    throws IllegalAccessException, InvocationTargetException
  {
    return vm.invokeSA("getThreads", new Object[0]);
  }
  
  SAObject getObjectHeap()
    throws IllegalAccessException, InvocationTargetException
  {
    return vm.invokeSA("getObjectHeap", new Object[0]);
  }
  
  SAObject getSystemDictionary()
    throws IllegalAccessException, InvocationTargetException
  {
    return vm.invokeSA("getSystemDictionary", new Object[0]);
  }
}

/* Location:
 * Qualified Name:     com.sun.tools.visualvm.sa.VM
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
1

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd