Class ShutdownHookProcessTracker

  • All Implemented Interfaces:
    io.github.mike10004.subprocess.ProcessTracker

    public class ShutdownHookProcessTracker
    extends Object
    implements io.github.mike10004.subprocess.ProcessTracker
    Process tracker that adds a shutdown hook to terminate processes that are still alive when the JVM exits. This is backed by the ProcessDestroyer from Apache Ant, which I vaguely trust, mostly because it's been around and heavily used for so long.
    • Constructor Detail

      • ShutdownHookProcessTracker

        public ShutdownHookProcessTracker()
    • Method Detail

      • getInstance

        public static io.github.mike10004.subprocess.ProcessTracker getInstance()
      • add

        public void add​(Process process)
        Specified by:
        add in interface io.github.mike10004.subprocess.ProcessTracker
      • remove

        public boolean remove​(Process process)
        Specified by:
        remove in interface io.github.mike10004.subprocess.ProcessTracker
      • activeCount

        public int activeCount()
        Specified by:
        activeCount in interface io.github.mike10004.subprocess.ProcessTracker