Examples of MonitoredVm


Examples of sun.jvmstat.monitor.MonitoredVm

                int i = ((Integer) obj).intValue();
                String s = obj.toString();
                boolean flag = false;
                String s1 = null;
                try {
                    MonitoredVm monitoredvm = monitoredhost.getMonitoredVm(new VmIdentifier(s));
                    s = MonitoredVmUtil.commandLine(monitoredvm);
                    flag = MonitoredVmUtil.isAttachable(monitoredvm);
                    s1 = ConnectorAddressLink.importFrom(i);
                    monitoredvm.detach();
                }
                catch (Exception exception) {
                }
                map.put((Integer) obj, new LocalVirtualMachine(i, s, flag, s1));
            }
View Full Code Here

Examples of sun.jvmstat.monitor.MonitoredVm

                int pid = ((Integer) vmid).intValue();
                String name = vmid.toString(); // default to pid if name not available
                boolean attachable = false;
                String address = null;
                try {
                     MonitoredVm mvm = host.getMonitoredVm(new VmIdentifier(name));
                     // use the command line as the display name
                     name =  MonitoredVmUtil.commandLine(mvm);
                     attachable = MonitoredVmUtil.isAttachable(mvm);
                     address = ConnectorAddressLink.importFrom(pid);
                     mvm.detach();
                } catch (Exception x) {
                     // ignore
                }
                map.put((Integer) vmid,
                        new LocalVirtualMachine(pid, name, attachable, address));
View Full Code Here

Examples of sun.jvmstat.monitor.MonitoredVm

        for (Object vmid: vms) {
            if (vmid instanceof Integer) {
                String pid = vmid.toString();
                String name = pid;      // default to pid if name not available
                boolean isAttachable = false;
                MonitoredVm mvm = null;
                try {
                    mvm = host.getMonitoredVm(new VmIdentifier(pid));
                    try {
                        isAttachable = MonitoredVmUtil.isAttachable(mvm);
                        // use the command line as the display name
                        name =  MonitoredVmUtil.commandLine(mvm);
                    } catch (Exception e) {
                    }
                    if (isAttachable) {
                        result.add(new HotSpotVirtualMachineDescriptor(this, pid, name));
                    }
                } catch (Throwable t) {
                    if (t instanceof ThreadDeath) {
                        throw (ThreadDeath)t;
                    }
                } finally {
                    if (mvm != null) {
                        mvm.detach();
                    }
                }
            }
        }
        return result;
View Full Code Here

Examples of sun.jvmstat.monitor.MonitoredVm

     * share memory buffer, this method returns.
     *
     * @exception AttachNotSupportedException if it's not attachable
     */
    void testAttachable(String id) throws AttachNotSupportedException {
        MonitoredVm mvm = null;
        boolean isKernelVM = false;
        try {
            VmIdentifier vmid = new VmIdentifier(id);
            MonitoredHost host = MonitoredHost.getMonitoredHost(vmid);
            mvm = host.getMonitoredVm(vmid);

            if (MonitoredVmUtil.isAttachable(mvm)) {
                // it's attachable; so return false
                return;
            }
            isKernelVM = MonitoredVmUtil.isKernelVM(mvm);
        } catch (Throwable t) {
            if (t instanceof ThreadDeath) {
                ThreadDeath td = (ThreadDeath)t;
                throw td;
            }
            // we do not know what this id is
            return;
        } finally {
            if (mvm != null) {
                mvm.detach();
            }
        }

        // we're sure it's not attachable; throw exception
        if (isKernelVM) {
View Full Code Here

Examples of sun.jvmstat.monitor.MonitoredVm

    // print the PIDs and other application info
    MonitoredHost monitoredHost = MonitoredHost.getMonitoredHost(new HostIdentifier((String) null));
    Set<Integer> activeVmPids = monitoredHost.activeVms();
    for (Integer vmPid : activeVmPids) {
      MonitoredVm mvm = monitoredHost.getMonitoredVm(new VmIdentifier(vmPid.toString()));
      System.out.println("" +
        "pid: " + vmPid.intValue() + ", " +
        "main class: " + MonitoredVmUtil.mainClass(mvm, true) + ", " +
        "command line: " + MonitoredVmUtil.commandLine(mvm) + "\n");
      mvm.detach();
    }
  }
View Full Code Here

Examples of sun.jvmstat.monitor.MonitoredVm

    MonitoredHost monitoredHost;
    Set<Integer> activeVmPids;
    try {
      monitoredHost = MonitoredHost.getMonitoredHost(new HostIdentifier((String) null));
      activeVmPids = monitoredHost.activeVms();
      MonitoredVm mvm = null;
      for (Integer vmPid : activeVmPids) {
        try {
          mvm = monitoredHost.getMonitoredVm(new VmIdentifier(vmPid.toString()));
          String mvmMainClass = MonitoredVmUtil.mainClass(mvm, true);
          if (mainClass.getName().equals(mvmMainClass)) {
            return vmPid;
          }
        } finally {
          if (mvm != null) {
            mvm.detach();
          }
        }
      }
    } catch (java.net.URISyntaxException e) {
      throw new InternalError(e.getMessage());
View Full Code Here

Examples of sun.jvmstat.monitor.MonitoredVm

    try {
      monitoredHost = MonitoredHost.getMonitoredHost(new HostIdentifier((String) null));
      activeVmPids = monitoredHost.activeVms();
      for (Integer vmPid : activeVmPids) {
        try {
          MonitoredVm mvm = monitoredHost.getMonitoredVm(new VmIdentifier(vmPid.toString()));
          result.add(new ActiveVm(vmPid.intValue(), MonitoredVmUtil.mainClass(mvm, true), MonitoredVmUtil.commandLine(mvm)));
          mvm.detach();
        } catch (Exception e) {
          result.add(new FailedActiveVm(vmPid.intValue(), e));
        }
      }
      return result;
View Full Code Here

Examples of sun.jvmstat.monitor.MonitoredVm

    MonitoredHost monitoredHost;
    Set<Integer> activeVmPids;
    try {
      monitoredHost = MonitoredHost.getMonitoredHost(new HostIdentifier((String) null));
      activeVmPids = monitoredHost.activeVms();
      MonitoredVm mvm = null;
      for (Integer vmPid : activeVmPids) {
        try {
          mvm = monitoredHost.getMonitoredVm(new VmIdentifier(vmPid.toString()));
          String mvmMainClass = MonitoredVmUtil.mainClass(mvm, true);
          if (mainClass.getName().equals(mvmMainClass)) {
            return vmPid;
          }
        } finally {
          if (mvm != null) {
            mvm.detach();
          }
        }
      }
    } catch (java.net.URISyntaxException e) {
      throw new InternalError(e.getMessage());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.