private UndeliverableReturnCode checkMessage ( SIMPMessage message ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "checkMessage" , message ) ; UndeliverableReturnCode rc = UndeliverableReturnCode . OK ; // F001333:E3 // If the message's reliability equals or is less than the configured ExceptionDiscardReliability // then the message shouldn't be sent on to the exception destination, instead it should simply // be thrown away (the default setting is BestEffort). // We'll always chuck away BestEffort messages, but if we have the original destination we'll base // our decision on its configuration // (If the _originalDestination is null then we do not have the original destination's config to hand, // for example, in the case of cleaning up a deleted destination) Reliability discardReliabilityThreshold = Reliability . BEST_EFFORT_NONPERSISTENT ; if ( _originalDestination != null ) discardReliabilityThreshold = _originalDestination . getExceptionDiscardReliability ( ) ; if ( message . getReliability ( ) . compareTo ( discardReliabilityThreshold ) <= 0 ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Message reliability (" + message . getReliability ( ) + ") <= Exception reliability (" + discardReliabilityThreshold + ")" ) ; rc = UndeliverableReturnCode . DISCARD ; } // Discard messages from temporary destinations. else if ( _originalDestination != null && _originalDestination . isTemporary ( ) ) rc = UndeliverableReturnCode . DISCARD ; // If the discardMessage option is set, then we discard the message rather // than send to the exception destination else if ( Boolean . TRUE . equals ( message . getMessage ( ) . getReportDiscardMsg ( ) ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Message discarded at sender's request" ) ; rc = UndeliverableReturnCode . DISCARD ; } // Decide whether we want to block the message or not. else if ( isBlockRequired ( message ) ) rc = UndeliverableReturnCode . BLOCK ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "checkMessage" , rc ) ; return rc ; }
Checks that a message is valid for delivery to an exception destination