public void writeSilenceForced ( TickRange vtr ) throws SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "writeSilenceForced" , new Object [ ] { vtr } ) ; long start = vtr . startstamp ; long end = vtr . endstamp ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { SibTr . debug ( tc , "writeSilenceForced from: " + start + " to " + end + " on Stream " + stream ) ; } TickRange tr = new TickRange ( TickRange . Completed , start , end ) ; // used to send message if it moves inside inDoubt window List sendList = null ; synchronized ( this ) { oststream . writeCompletedRangeForced ( tr ) ; // Check whether removing this message means we have // a message to send TickRange str = null ; if ( ( str = msgRemoved ( vtr . valuestamp , oststream , null ) ) != null ) { sendList = new LinkedList ( ) ; sendList . add ( str ) ; if ( str . valuestamp > lastMsgSent ) lastMsgSent = str . valuestamp ; } } // Do the send outside of the synchronise if ( sendList != null ) { sendMsgs ( sendList , false ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "writeSilenceForced" ) ; }
This method uses a Value TickRange to write Silence into the stream because a message has expired before it was sent and so needs to be removed from the stream It forces the stream to be updated to Silence without checking the existing state