
org.snapscript.studio.agent.local.LocalNameGenerator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of snap-agent Show documentation
Show all versions of snap-agent Show documentation
Dynamic scripting for the JVM
The newest version!
package org.snapscript.studio.agent.local;
import java.util.UUID;
public class LocalNameGenerator {
private static final String PROCESS_PREFIX = "process";
public static String getProcess() {
return String.format("%s-%s", PROCESS_PREFIX, getProcessId());
}
private static String getProcessId() {
try {
return java.lang.management.ManagementFactory.getRuntimeMXBean().getName().split("@")[0];
}catch(Exception e) {
return UUID.randomUUID().toString();
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy