如何在 google appengine 中实现关闭挂钩处理程序。我在这里不理解他们的文档https://developers.google.com/appengine/docs/java/backends/overview#Shutdown。我需要的是,当后端由于任何原因停止时,我需要在代码中得到通知。
this is my code
try{
while (haveMoreWork() &&
!LifecycleManager.getInstance().isShuttingDown()) {
process(); // this is my function to read all the data.if it fails because of termination.i need to be notified.
}catch(Exception e){
log.log(Level.SEVERE, e.getMessage(), e);
log.severe("error occured"+e);
log.info("failed ");
}