Package org.elasticsearch.common
Class PidFile
java.lang.Object
org.elasticsearch.common.PidFile
Process ID file abstraction that writes the current pid into a file and optionally
removes it on system exit.
-
Method Summary
-
Method Details
-
create
Creates a new PidFile and writes the current process ID into the provided path- Parameters:
path
- the path to the pid file. The file is newly created or truncated if it already existsdeleteOnExit
- iftrue
the pid file is deleted with best effort on system exit- Throws:
IOException
- if an IOException occurs
-
getPid
public long getPid()Returns the current process id -
getPath
Returns the process id file path -
isDeleteOnExit
public boolean isDeleteOnExit()Returnstrue
iff the process id file is deleted on system exit. Otherwisefalse
.
-