Package sun.jvmstat.monitor

Examples of sun.jvmstat.monitor.VmIdentifier


                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();
                }
View Full Code Here


                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();
View Full Code Here

                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();
View Full Code Here

                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) {
View Full Code Here

     */
    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
View Full Code Here

            }
        }

        // verify that the vm identifier is valied
        try {
            vmId = new VmIdentifier(vmIdString);
        } catch (URISyntaxException e) {
            IllegalArgumentException iae = new IllegalArgumentException(
                    "Malformed VM Identifier: " + vmIdString);
            iae.initCause(e);
            throw iae;
View Full Code Here

    // 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

      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 {
View Full Code Here

    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));
        }
View Full Code Here

      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 {
View Full Code Here

TOP

Related Classes of sun.jvmstat.monitor.VmIdentifier

Copyright © 2018 www.massapicom. 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.