determines if the interval has elapsed before executing the availabilitycommand . it is ideal this task is run on short intervals to check if the interval has elapsed . concode_field_sep Logger LOGGER concode_elem_sep String sourceId concode_elem_sep int ONE_SECOND concode_elem_sep AvailabilityCommand availabilityCommand concode_elem_sep AtomicLong lastAvailableTimestamp concode_elem_sep int NO_DELAY concode_elem_sep long interval concode_elem_sep boolean isAvailable concode_field_sep boolean isAvailable concode_elem_sep void setInterval concode_elem_sep void updateLastAvailableTimestamp
void function ( ) { if ( ( System . currentTimeMillis ( ) - lastAvailableTimestamp . get ( ) ) >= interval ) { isAvailable = availabilityCommand . isAvailable ( ) ; LOGGER . debug ( "srini_string" , sourceId , isAvailable ) ; updateLastAvailableTimestamp ( System . currentTimeMillis ( ) ) ; } }