def fire_lifecycle_event(self, new_state):
if new_state == LIFECYCLE_STATE_SHUTTING_DOWN:<EOL><INDENT>self.is_live = False<EOL><DEDENT>self.state = new_state<EOL>self.logger.info(self._git_info + "<STR_LIT>", new_state, extra=self._logger_extras)<EOL>for listener in list(self._listeners.values()):<EOL><INDENT>try:<EOL><INDENT>listener(new_state)<EOL><DEDENT>except:<EOL><INDENT>self.logger.exception("<STR_LIT>", extra=self._logger_extras)<EOL><DEDENT><DEDENT>
Called when instance's state changes.

:param new_state: (Lifecycle State), the new state of the instance.