Exemple #1
0
 def onTermination(self):
     """Trigger that gets called before the object is terminated."""
     for inst in self.objectValues():
         controller = ILifeCycleController(inst)
         if controller.state != 'ended':
             controller.terminate('Terminated due to termination of %s.' %
                                  self.log_name)
Exemple #2
0
 def onReset(self):
     """Trigger that gets called after the object is reset."""
     for inst in self.objectValues():
         controller = ILifeCycleController(inst)
         if controller.state != 'ended':
             controller.terminate('Terminated due to reset of %s.' %
                                  self.log_name)
Exemple #3
0
 def manage_action(
     self,
     action,
     REQUEST,
     comment="no comment",
 ):
     """Multiplexes the actions."""
     controller = ILifeCycleController(self)
     if action == "start":
         controller.start(comment)
     elif action == "reset":
         controller.reset(comment)
     elif action == "terminate":
         controller.terminate(comment)
     elif action == "restart":
         controller.reset(comment)
         controller.start(comment)
     elif action == "recover":
         controller.recover(comment)
     elif action == "fail":
         controller.fail(comment)
     else:
         raise KeyError("Not a valid action.")
     REQUEST.RESPONSE.redirect(self.absolute_url() + "/manage_overview")