private VirtualConnection startEarlyRead ( InterChannelCallback cb , boolean forceQueue ) { // disallow rewrites once we start mixing the request and temp responses getLink ( ) . disallowRewrites ( ) ; setAppReadCallback ( cb ) ; // check for an existing final response if ( headersParsed ( ) && ! getResponseImpl ( ) . isTemporaryStatusCode ( ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "earlyRead: Final response already received." ) ; } if ( forceQueue ) { cb . complete ( getVC ( ) ) ; return null ; } return getVC ( ) ; } // otherwise, if a message is already parsed, then the assumption is // that the app channel above has already looked at it and is now asking // for the next, so clear out the previous message and start a read if ( headersParsed ( ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "earlyRead: Message exists, isOwner: " + isResponseOwner ( ) ) ; } resetMsgParsedState ( ) ; if ( ! isResponseOwner ( ) ) { // null our reference as not being owner means another SC has this // message already (i.e. the proxy passed it to the inbound // side) and then create the new object setMyResponse ( null ) ; getResponseImpl ( ) ; } else { // otherwise clear the existing response getResponseImpl ( ) . clear ( ) ; } } // start the read/parse cycle for the next response message VirtualConnection vc = parseResponseMessageAsync ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "earlyRead: return vc=" + vc ) ; } if ( null != vc && forceQueue ) { cb . complete ( getVC ( ) ) ; return null ; } return vc ; }
Common utility method to start the response read now regardless of the request message state .