public void setupReadListener ( ReadListener readListenerl , SRTUpgradeInputStream31 srtUpgradeStream ) { if ( readListenerl == null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isErrorEnabled ( ) ) Tr . error ( tc , "readlistener.is.null" ) ; throw new NullPointerException ( Tr . formatMessage ( tc , "readlistener.is.null" ) ) ; } if ( _rl != null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isErrorEnabled ( ) ) Tr . error ( tc , "readlistener.already.started" ) ; throw new IllegalStateException ( Tr . formatMessage ( tc , "readlistener.already.started" ) ) ; } //Save off the current Thread data by creating the ThreadContextManager. Then pass it into the callback ThreadContextManager tcm = new ThreadContextManager ( ) ; _tcpChannelCallback = new UpgradeReadCallback ( readListenerl , this , tcm , srtUpgradeStream ) ; _rl = readListenerl ; _isReady = false ; _upConn . getVirtualConnection ( ) . getStateMap ( ) . put ( TransportConstants . UPGRADED_LISTENER , "true" ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "setupReadListener, Starting the initial read" ) ; } initialRead ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "setupReadListener, ReadListener set : " + _rl ) ; } }
Sets the ReadListener provided by the application to this stream Once the ReadListener is set we will kick off the initial read