Implement different Exception Classes
Perhaps it is bette to provide different Exception classes. For e.g. "public void onTerminating() throws Exception", it would be better to change it to a "TerminatingException", which will be way better for debugging.