package org.cobbzilla.util.daemon;

import com.fasterxml.jackson.annotation.JsonCreator;
import lombok.AllArgsConstructor;
import lombok.Getter;

@AllArgsConstructor
public enum TerminationRequestResult {

    alive (true),
    dead (false),
    interrupted_alive (true),
    interrupted_dead (false),
    terminated (false);

    @Getter private final boolean running;

    public boolean alive () { return running; }
    public boolean dead () { return !running; }

    @JsonCreator public static TerminationRequestResult fromString (String val) { return valueOf(val.toLowerCase()); }

}

@@ -459,16 +459,93 @@
 nning; %7D
+%0A    public boolean cleanlyDead () %7B return !running && this != terminated; %7D
 %0A%0A    @J

add cleanlyDead method to TerminationRequestResult