docs: function ()  {
              const self = this;
  
              let _restartCount = 0;
  
              self.startListening = (cronTasks) => {
                  var self = this;
                  self.cronTasks = cronTasks;
                  return JobManagementDbConnector.registerNewServer(Shared.getCurrentHostId(), _restartCount++)
                      .then(result => Q(result._id)).then(serverId => self.initializeJob(serverId));
              };
  
              self.initialize = () => {
                  const promises = [];
                  Shared.cronModules(self.cronTasks).forEach(cronModule => {
                      if (cronModule.identity !== self.identity) {
                          promises.push(cronModule.initializeJob(self.getUniqueServerId()));
                      }
                  });
  
                  return Q.allSettled(promises).then( () => Q());
              };
  
              self.onServerDeletedHandler =  err => {
                  //Logger('err', "Cron: '" + self.identity + "' has detected that the server entry was removed from DB and will create new server entry.");
                  return Q();
              };
  
              const _cleanServers =  () => {
                  const initialServerUniqueId = self.getUniqueServerId();
                  return JobManagementDbConnector.doHeartbeat(initialServerUniqueId).catch(err => {
                      Logger.error("Cron heartbeat for server id " + initialServerUniqueId + " failed", err);
                      return JobManagementDbConnector.registerNewServer(Shared.getCurrentHostId(), _restartCount);
                  }).then(newServerInfo => {
                      const newServerUniqueId = newServerInfo._id;
                      if (newServerUniqueId && !newServerUniqueId.equals(initialServerUniqueId)) {
                          ++_restartCount;
                          Logger.info("This server was assigned a new unique id " + newServerUniqueId);
  
                          //update server ids
                          self.setUniqueServerId(newServerUniqueId);
                          Shared.cronModules(self.cronTasks).forEach(cronModule => {
                              if (cronModule.identity !== self.identity) {
                                  cronModule.setUniqueServerId(newServerUniqueId);
                              }
                          });
                      }
                      return Q();
                  }).then(() => {
                      return JobManagementDbConnector.cleanJobsOfDeadServers(_deathInterval).then(deadServersCount => {
                          if (deadServersCount > 0) {
                              Logger.info("Killed all jobs on " + deadServersCount + " server(s) without heartbeat");
                          }
                          return Q();
                      });
                  });
              };
  
              const _updateJobConfigs = () => {
                  var promises = [];
                  Shared.cronModules(self.cronTasks).forEach(cronModule => {
                      if (cronModule.identity != self.identity) {
                          promises.push(cronModule.updateJob());
                      }
                  });
                  //update itself
                  promises.push(self.updateJob());
                  return Q.allSettled(promises).then(() => Q());
              };
  
              self.worker = () => {
                  return Q.allSettled([
                      _cleanServers(),
                      _updateJobConfigs()
                  ]);
              };
          }