Class PidFile

org.elasticsearch.common.PidFile

public final class PidFile extends
Process ID file abstraction that writes the current pid into a file and optionally removes it on system exit.
  • Method Summary

    Modifier and Type
    Method
    Description
    static PidFile
     path, boolean deleteOnExit)
    Creates a new PidFile and writes the current process ID into the provided path
    Returns the process id file path
    long
    Returns the current process id
    boolean
    Returns true iff the process id file is deleted on system exit.

    Methods inherited from class java.lang.

    , , , , , , , , , ,
  • Method Details

    • create

      public static  path, boolean deleteOnExit) throws
      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 exists
      deleteOnExit - if true the pid file is deleted with best effort on system exit
      Throws:
      - if an IOException occurs
    • getPid

      public long getPid()
      Returns the current process id
    • getPath

      public  getPath()
      Returns the process id file path
    • isDeleteOnExit

      public boolean isDeleteOnExit()
      Returns true iff the process id file is deleted on system exit. Otherwise false.