public void alarm ( Object alarmContext ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "alarm" , alarmContext ) ; // Alarm context should be an sid, make it so. SIBUuid12 sid = ( SIBUuid12 ) alarmContext ; // synchronized here in case we're racing with an answer to our // query. synchronized ( flushMap ) { // See if the query record is still around FlushQueryRecord entry = flushMap . get ( sid ) ; if ( entry != null ) { // Query still active, see if we need to restart. entry . attempts -- ; if ( entry . attempts > 0 ) { // Yup, resend the query and reset the alarm. If // entry.cached is null, then this is a "request flush" // rather than an "are you flushed". try { if ( entry . cache == null ) { upControl . sendRequestFlushMessage ( entry . source , entry . destId , entry . busId , entry . requestID , sid , false ) ; //TODO check indoubtDiscard } else { upControl . sendAreYouFlushedMessage ( entry . source , entry . destId , entry . busId , entry . requestID , sid ) ; } } catch ( SIResourceException e ) { // No FFDC code needed // If we run out of resources, then give up on the query // and log an error. This is probably only important for // "request flush" queries. flushMap . remove ( sid ) ; // TODO: actually, this should be an admin message. if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) SibTr . event ( tc , "Flush query failed for stream: " + sid ) ; } } else { // Nope, didn't work. Remove the query record, log the event, // and exit. flushMap . remove ( sid ) ; // TODO: actually, this should be an admin message. if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) SibTr . event ( tc , "Flush query expired for stream: " + sid ) ; } } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "alarm" ) ; }
This method is called when an alarm expires for an are you flushed or flush request query .