@Override public void run(){
  _log.info("SendEventScheduler::run() start");
  try {
    if (!_callHomeEventManager.canSendEvent()) {
      return;
    }
    int totalSleep=0;
    while (true) {
      if (_licenseManager.getTargetInfoLock()) {
        try {
          performSendEvents();
        }
 catch (        Exception e) {
          _log.error("Exception sending events to SYR: {} ",e);
          break;
        }
 finally {
          _licenseManager.releaseTargetVersionLock();
        }
        break;
      }
 else {
        _log.info("Cannot acquire TargetLock. Sleeping 5s before retrying...");
        if (totalSleep >= CallHomeConstants.MAX_LOCK_WAIT_TIME_MS) {
          _log.warn("Cannot acquire TargetLock in {}ms. So quitting SendEventScheduler",CallHomeConstants.MAX_LOCK_WAIT_TIME_MS);
          break;
        }
        Thread.sleep(CallHomeConstants.LOCK_WAIT_TIME_MS);
        totalSleep+=CallHomeConstants.LOCK_WAIT_TIME_MS;
      }
    }
  }
 catch (  APIException i) {
    _log.info("ConnectEMC is not configured. Ending SendEventScheduler.");
  }
catch (  Exception e) {
    _log.error("Exception while running event scheduler: {} ",e);
  }
  _log.info("SendEventScheduler::run() end");
}

@ Override public void run ( ) { _log . info ( "SendEventScheduler::run() start" ) ; try { if ( ! _callHomeEventManager . canSendEvent ( ) ) { return ; } int totalSleep = 0 ; while ( true ) { if ( _licenseManager . getTargetInfoLock ( ) ) { try { performSendEvents ( ) ; } catch ( Exception e ) { _log . error ( "Exception sending events to SYR: {} " , e ) ; break ; } finally { _licenseManager . releaseTargetVersionLock ( ) ; } break ; } else { _log . info ( "Cannot acquire TargetLock. Sleeping 5s before retrying..." ) ; if ( totalSleep >= CallHomeConstants . MAX_LOCK_WAIT_TIME_MS ) { _log . warn ( "Cannot acquire TargetLock in {}ms. So quitting SendEventScheduler" , CallHomeConstants . MAX_LOCK_WAIT_TIME_MS ) ; break ; } Thread . sleep ( CallHomeConstants . LOCK_WAIT_TIME_MS ) ; totalSleep += CallHomeConstants . LOCK_WAIT_TIME_MS ; } } } catch ( APIException i ) { _log . info ( "ConnectEMC is not configured. Ending SendEventScheduler." ) ; } catch ( Exception e ) { _log . error ( "Exception while running event scheduler: {} " , e ) ; } _log . info ( "SendEventScheduler::run() end" ) ; }
method which sends the heartbeat event and also verifies if the license has expired . if so , it will send a license expiration event . runs once per day .
