def METHOD_NAME(self):
    self.log = logging.getLogger(self.name)
    self.log.info("creating new handler (PID %s)", self.pid)
    try:
        self.target = self.env.get_target(self.name)
        self.context['target'] = self.target
        if self.target is None:
            raise KeyError
    except Exception:  # pylint: disable=broad-except
        self.log.exception("target creation failed")
        return
    self.setup = self._get_setup_function()
    self.setup()
    self.initial_resource = self._get_initial_resource()
    self.handler = self._get_handler_function()
    while self.run_once():
        sleep(3)