Top Description Fields Constructors Methods
org.eclipse.jetty.util

public Class PidFile

extends Thread
Class Inheritance
Imports
java.io.IOException, java.nio.file.Files, .Path, .Paths, java.util.Set, java.util.concurrent.ConcurrentHashMap, org.eclipse.jetty.util.annotation.Name, org.slf4j.Logger, .LoggerFactory

Create a PID file for the running process.

Will register itself in a Runtime#addShutdownHook(Thread) to cleanup the PID file it created during normal JVM shutdown.

Field Summary

Modifier and TypeField and Description
private static final Set<Path>
private static final Logger
private final Path
Inherited from java.lang.Thread:
MAX_PRIORITYMIN_PRIORITYNORM_PRIORITY

Constructor Summary

AccessConstructor and Description
private
PidFile(Path pidFile)

Method Summary

Modifier and TypeMethod and Description
public static void
create(String filename)

public void
run()

Overrides java.lang.Thread.run.

Implements java.lang.Runnable.run.

This method is run by the thread when it executes.

Inherited from java.lang.Thread:
activeCountcheckAccessclonecurrentThreaddumpStackenumerategetAllStackTracesgetContextClassLoadergetDefaultUncaughtExceptionHandlergetIdgetNamegetPrioritygetStackTracegetStategetThreadGroupgetUncaughtExceptionHandlerholdsLockinterruptinterruptedisAliveisDaemonisInterruptedisVirtualjoinjoinjoinjoinofPlatformofVirtualonSpinWaitsetContextClassLoadersetDaemonsetDefaultUncaughtExceptionHandlersetNamesetPrioritysetUncaughtExceptionHandlersleepsleepsleepstartstartVirtualThreadthreadIdtoStringyield

Field Detail

activeFilesback to summary
private static final Set<Path> activeFiles
LOGback to summary
private static final Logger LOG
pidFileback to summary
private final Path pidFile

Constructor Detail

PidFileback to summary
private PidFile(Path pidFile)

Method Detail

createback to summary
public static void create(String filename) throws IOException
runback to summary
public void run()

Overrides java.lang.Thread.run.

Implements java.lang.Runnable.run.

Doc from java.lang.Thread.run.

This method is run by the thread when it executes. Subclasses of Thread may override this method.

This method is not intended to be invoked directly. If this thread is a platform thread created with a Runnable task then invoking this method will invoke the task's run method. If this thread is a virtual thread then invoking this method directly does nothing.

Annotations
@Override