All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.hawt.jvm.local.VMDescriptorDTO Maven / Gradle / Ivy

There is a newer version: 4.1.0
Show newest version
package io.hawt.jvm.local;

import com.sun.tools.attach.VirtualMachineDescriptor;

/**
 * @author Stan Lewis
 */
public class VMDescriptorDTO {

    private VirtualMachineDescriptor descriptor;
    private String alias;
    private String agentUrl;

    public VMDescriptorDTO(VirtualMachineDescriptor descriptor) {
        this.descriptor = descriptor;
        this.alias = JVMList.getVmAlias(descriptor.displayName());
    }

    public String getId() {
        return descriptor.id();
    }

    public String getAlias() {
        return alias;
    }

    public String getDisplayName() {
        return descriptor.displayName();
    }

    public String getAgentUrl() {
        return agentUrl;
    }

    public void setAgentUrl(String url) {
        this.agentUrl = url;
    }

    @Override
    public String toString() {
        String agentEnabled = "*";
        if (getAgentUrl() == null) {
            agentEnabled = " ";
        }
        return getId() + " : [" + agentEnabled + "] " + getAlias() + " (" + getDisplayName() + ")";
    }


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy