public final class PidFile extends Object
| Modifier and Type | Method and Description |
|---|---|
static PidFile |
create(Path path,
boolean deleteOnExit)
Creates a new PidFile and writes the current process ID into the provided path
|
Path |
getPath()
Returns the process id file path
|
long |
getPid()
Returns the current process id
|
boolean |
isDeleteOnExit()
Returns
true iff the process id file is deleted on system exit. |
public static PidFile create(Path path, boolean deleteOnExit) throws IOException
path - the path to the pid file. The file is newly created or truncated if it already existsdeleteOnExit - if true the pid file is deleted with best effort on system exitIOException - if an IOException occurspublic long getPid()
public Path getPath()
public boolean isDeleteOnExit()
true iff the process id file is deleted on system exit. Otherwise false.Copyright © 2009–2017. All rights reserved.