@Override
  protected void doStart() throws Exception {
    setLeader(tryTakeLeadership());
    watch();

    super.doStart();
  }
  @Override
  protected void doStop() throws Exception {
    if (managedClient) {
      client.close();
    }

    super.doStop();
  }