@ Override public void complete ( VirtualConnection vc , TCPWriteRequestContext wsc ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "complete() called: vc=" + vc ) ; } HttpInboundServiceContextImpl mySC = ( HttpInboundServiceContextImpl ) vc . getStateMap ( ) . get ( CallbackIDs . CALLBACK_HTTPISC ) ; if ( null != wsc ) { wsc . setBuffers ( null ) ; } // access logging if the finishResponse API was used if ( mySC . isMessageSent ( ) ) { mySC . logFinalResponse ( mySC . getNumBytesWritten ( ) ) ; HttpInvalidMessageException inv = mySC . checkResponseValidity ( ) ; if ( null != inv ) { // response was invalid in some way... error scenario mySC . setPersistent ( false ) ; if ( null != mySC . getAppWriteCallback ( ) ) { mySC . getAppWriteCallback ( ) . error ( vc , inv ) ; } return ; } } // if a callback exists above, pass along the complete. But if the // app channel didn't give us a callback (it doesn't care) then we // can't pass anything along and we stop further work here if ( null != mySC . getAppWriteCallback ( ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Calling write complete callback of app channel." ) ; } if ( mySC . getResponseImpl ( ) . isTemporaryStatusCode ( ) ) { // allow other responses to follow a temporary one if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Temp response sent, resetting send flags" ) ; } mySC . resetWrite ( ) ; } mySC . getAppWriteCallback ( ) . complete ( vc ) ; } else { // this is dangerous since we're not notifying the channel above // of the complete work, but they don't care since they didn't // give us a callback to use... hopefully they will continue this // connection properly. if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "No available app channel callback" ) ; } } }
Called by the channel below us when a write has finished .