private boolean isImmediatelySendable ( final AbstractBody msg ) { assertLocked ( ) ; if ( cmParams == null ) { // block if we're waiting for a response to our first request return exchanges . isEmpty ( ) ; } AttrRequests requests = cmParams . getRequests ( ) ; if ( requests == null ) { return true ; } int maxRequests = requests . intValue ( ) ; if ( exchanges . size ( ) < maxRequests ) { return true ; } if ( exchanges . size ( ) == maxRequests && ( isTermination ( msg ) || isPause ( msg ) ) ) { // One additional terminate or pause message is allowed return true ; } return false ; }
Determines if the message specified is immediately sendable or if it needs to block until the session state changes .