private synchronized boolean msgCanBeSent ( long stamp , boolean nackMsg ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "msgCanBeSent" , new Object [ ] { Long . valueOf ( stamp ) , Boolean . valueOf ( nackMsg ) , Long . valueOf ( firstMsgOutsideWindow ) , Boolean . valueOf ( containsGuesses ) } ) ; boolean sendMessage = true ; // Check whether we can send the message // Don't send any messages once there is a guess in the stream (unless a NACK) if ( ( stamp >= firstMsgOutsideWindow ) || ( containsGuesses && ! nackMsg ) ) { sendMessage = false ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { SibTr . debug ( tc , "firstMsgOutsideWindow is: " + firstMsgOutsideWindow + " sendWindow is " + sendWindow + " containsGuesses is " + containsGuesses ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "msgCanBeSent" , Boolean . valueOf ( sendMessage ) ) ; return sendMessage ; }
Method that determines if the message can be sent .