public void alarm ( final Object alarmContext ) { final String methodName = "alarm()" ; synchronized ( this ) { if ( ! stopping && ! this . htod . invalidationBuffer . isDiskClearInProgress ( ) ) { this . htod . invalidationBuffer . invokeBackgroundInvalidation ( HTODInvalidationBuffer . SCAN ) ; } else if ( stopping ) { traceDebug ( methodName , "cacheName=" + this . cacheName + " abort disk cleanup because of server is stopping." ) ; } else { if ( cleanupFrequency == 0 ) { sleepTime = calculateSleepTime ( ) ; } traceDebug ( methodName , "cacheName=" + this . cacheName + " disk clear is in progress - skip disk scan and set alarm sleepTime=" + sleepTime ) ; Scheduler . createNonDeferrable ( sleepTime , alarmContext , new Runnable ( ) { @ Override public void run ( ) { alarm ( alarmContext ) ; } } ) ; } } }
Call this method when the alarm is triggered . It is being checked to see whether a disk cleanup is scheduled to run .