private void rolloverLogTask(){
  try {
    if (_isInit) {
      flush();
    }
  }
 catch (  Exception e) {
    log.log(Level.WARNING,e.toString(),e);
  }
  _isRollingOver=true;
  try {
    if (!_isInit)     return;
    Path savedPath=null;
    long now=CurrentTime.currentTime();
    long lastPeriodEnd=_nextPeriodEnd;
    _nextPeriodEnd=nextRolloverTime(now);
    Path path=getPath();
synchronized (_logLock) {
      flushTempStream();
      long length=Files.size(path);
      if (lastPeriodEnd <= now && lastPeriodEnd > 0) {
        closeLogStream();
        savedPath=getSavedPath(lastPeriodEnd - 1);
      }
 else       if (path != null && getRolloverSize() <= length) {
        closeLogStream();
        savedPath=getSavedPath(now);
      }
    }
    if (savedPath != null) {
      movePathToArchive(savedPath);
    }
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
 finally {
synchronized (_logLock) {
      _isRollingOver=false;
      flushTempStream();
    }
    _rolloverListener.requeue(_rolloverAlarm);
  }
}

private void rolloverLogTask ( ) { try { if ( _isInit ) { flush ( ) ; } } catch ( Exception e ) { log . log ( Level . WARNING , e . toString ( ) , e ) ; } _isRollingOver = true ; try { if ( ! _isInit ) return ; Path savedPath = null ; long now = CurrentTime . currentTime ( ) ; long lastPeriodEnd = _nextPeriodEnd ; _nextPeriodEnd = nextRolloverTime ( now ) ; Path path = getPath ( ) ; synchronized ( _logLock ) { flushTempStream ( ) ; long length = Files . size ( path ) ; if ( lastPeriodEnd <= now && lastPeriodEnd > 0 ) { closeLogStream ( ) ; savedPath = getSavedPath ( lastPeriodEnd - 1 ) ; } else if ( path != null && getRolloverSize ( ) <= length ) { closeLogStream ( ) ; savedPath = getSavedPath ( now ) ; } } if ( savedPath != null ) { movePathToArchive ( savedPath ) ; } } catch ( IOException e ) { e . printStackTrace ( ) ; } finally { synchronized ( _logLock ) { _isRollingOver = false ; flushTempStream ( ) ; } _rolloverListener . requeue ( _rolloverAlarm ) ; } }
called from rollover worker
