Class ApplicationPid

java.lang.Object
org.springframework.boot.system.ApplicationPid

public class ApplicationPid extends Object
An application process ID.
Since:
2.0.0
  • Constructor Details

    • ApplicationPid

      public ApplicationPid()
    • ApplicationPid

      protected ApplicationPid(Long pid)
  • Method Details

    • isAvailable

      public boolean isAvailable()
      Return if the application PID is available.
      Returns:
      true if the PID is available
      Since:
      3.4.0
    • toLong

      public Long toLong()
      Return the application PID as a Long.
      Returns:
      the application PID or null
      Since:
      3.4.0
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • write

      public void write(File file) throws IOException
      Write the PID to the specified file.
      Parameters:
      file - the PID file
      Throws:
      IllegalStateException - if no PID is available.
      IOException - if the file cannot be written