Search in sources :

Example 26 with VirtualMachineDescriptor

use of com.sun.tools.attach.VirtualMachineDescriptor in project openj9 by eclipse.

the class TestAttachAPI method findVmdForPid.

private VirtualMachineDescriptor findVmdForPid(AttachProvider provider, String pid) {
    List<VirtualMachineDescriptor> vmdList = provider.listVirtualMachines();
    if (vmdList.size() < 1) {
        return null;
    }
    Iterator<VirtualMachineDescriptor> vmdi = vmdList.iterator();
    VirtualMachineDescriptor vmd = null;
    while (vmdi.hasNext()) {
        VirtualMachineDescriptor tempVmd = vmdi.next();
        if (tempVmd.id().equals(pid)) {
            vmd = tempVmd;
            break;
        }
    }
    return vmd;
}
Also used : VirtualMachineDescriptor(com.sun.tools.attach.VirtualMachineDescriptor)

Aggregations

VirtualMachineDescriptor (com.sun.tools.attach.VirtualMachineDescriptor)26 IOException (java.io.IOException)16 AttachNotSupportedException (com.sun.tools.attach.AttachNotSupportedException)13 AttachProvider (com.sun.tools.attach.spi.AttachProvider)12 VirtualMachine (com.sun.tools.attach.VirtualMachine)11 Test (org.testng.annotations.Test)7 ArrayList (java.util.ArrayList)5 Msg.getString (com.ibm.oti.util.Msg.getString)2 AgentLoadException (com.sun.tools.attach.AgentLoadException)2 File (java.io.File)2 URISyntaxException (java.net.URISyntaxException)2 JMXServiceURL (javax.management.remote.JMXServiceURL)2 MonitorException (sun.jvmstat.monitor.MonitorException)2 ImmutableMap (com.google.common.collect.ImmutableMap)1 FileLock (com.ibm.tools.attach.target.FileLock)1 Reply (com.ibm.tools.attach.target.Reply)1 AgentInitializationException (com.sun.tools.attach.AgentInitializationException)1 AttachOperationFailedException (com.sun.tools.attach.AttachOperationFailedException)1 CommonContext (io.aeron.CommonContext)1 AeronCluster (io.aeron.cluster.client.AeronCluster)1