public synchronized void stopRecording(){
  if (isRecordingOn()) {
    if (null != stopRecordingFuture) {
      if (!stopRecordingFuture.isDone() && !stopRecordingFuture.isCancelled()) {
        stopRecordingFuture.cancel(false);
      }
      stopRecordingFuture=null;
    }
    Collection<AbstractDataProcessor> recordingDataProcessors=recordingProperties.getRecordingDataProcessors();
    if (null != recordingDataProcessors) {
      for (      AbstractDataProcessor abstractDataProcessor : recordingDataProcessors) {
        abstractDataProcessor.flush();
      }
    }
    if (!involvedAgentsSet.isEmpty()) {
      List<SystemInformationData> toRecord=storageDataDao.getSystemInformationData(involvedAgentsSet);
      for (      SystemInformationData defaultData : toRecord) {
        record(defaultData);
      }
    }
    involvedAgentsSet.clear();
    if (log.isDebugEnabled()) {
      log.info("Recording stopped for storage: " + getStorageData());
    }
  }
 else   if (isRecordingScheduled()) {
    if (null != startRecordingFuture) {
      if (!startRecordingFuture.isDone() && !startRecordingFuture.isCancelled()) {
        startRecordingFuture.cancel(false);
      }
      startRecordingFuture=null;
    }
  }
  storageWriter=null;
  recordingProperties=null;
  recordingState=RecordingState.OFF;
}

public synchronized void stopRecording ( ) { if ( isRecordingOn ( ) ) { if ( null != stopRecordingFuture ) { if ( ! stopRecordingFuture . isDone ( ) && ! stopRecordingFuture . isCancelled ( ) ) { stopRecordingFuture . cancel ( false ) ; } stopRecordingFuture = null ; } Collection < AbstractDataProcessor > recordingDataProcessors = recordingProperties . getRecordingDataProcessors ( ) ; if ( null != recordingDataProcessors ) { for ( AbstractDataProcessor abstractDataProcessor : recordingDataProcessors ) { abstractDataProcessor . flush ( ) ; } } if ( ! involvedAgentsSet . isEmpty ( ) ) { List < SystemInformationData > toRecord = storageDataDao . getSystemInformationData ( involvedAgentsSet ) ; for ( SystemInformationData defaultData : toRecord ) { record ( defaultData ) ; } } involvedAgentsSet . clear ( ) ; if ( log . isDebugEnabled ( ) ) { log . info ( "Recording stopped for storage: " + getStorageData ( ) ) ; } } else if ( isRecordingScheduled ( ) ) { if ( null != startRecordingFuture ) { if ( ! startRecordingFuture . isDone ( ) && ! startRecordingFuture . isCancelled ( ) ) { startRecordingFuture . cancel ( false ) ; } startRecordingFuture = null ; } } storageWriter = null ; recordingProperties = null ; recordingState = RecordingState . OFF ; }
stops recording by flushing all the recording processors .
