Lets assume that there is a vm running on any machine (Linux/windows etc ). Now assuming its on linux machine ,I execute pkill -9 {processId} for the particular vm . I want to know if there is any way in java code to know if the process was interrupted and post interruption I want to execute some backup code or some action before the process gets killed .
Is it possible ? I just want to get to the basics of this and any clue or suggestion would be highly helpful.
Thanks