Called when instance's state changes.

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

def fire_lifecycle_event(self, new_state):
        """
        Called when instance's state changes.

        :param new_state: (Lifecycle State), the new state of the instance.
        """
        if new_state == LIFECYCLE_STATE_SHUTTING_DOWN:
            self.is_live = False

        self.state = new_state
        self.logger.info(self._git_info + "HazelcastClient is %s", new_state, extra=self._logger_extras)
        for listener in list(self._listeners.values()):
            try:
                listener(new_state)
            except:
                self.logger.exception("Exception in lifecycle listener", extra=self._logger_extras)