private void handleAsyncError ( boolean forceQueue , IOException exception , TCPReadCompletedCallback inCallback ) { boolean fireHere = true ; if ( forceQueue ) { // Error must be returned on a separate thread. // Reuse queuedWork object (performance), but reset the error parameters. queuedWork . setErrorParameters ( getConnLink ( ) . getVirtualConnection ( ) , this , inCallback , exception ) ; EventEngine events = SSLChannelProvider . getEventService ( ) ; if ( null == events ) { Exception e = new Exception ( "missing event service" ) ; FFDCFilter . processException ( e , getClass ( ) . getName ( ) , "503" , this ) ; // fall-thru below and use callback here regardless } else { // fire an event to continue this queued work Event event = events . createEvent ( SSLEventHandler . TOPIC_QUEUED_WORK ) ; event . setProperty ( SSLEventHandler . KEY_RUNNABLE , this . queuedWork ) ; events . postEvent ( event ) ; fireHere = false ; } } if ( fireHere ) { // Call the callback right here. inCallback . error ( getConnLink ( ) . getVirtualConnection ( ) , this , exception ) ; } }
This method handles errors when they occur during the code path of an async read . It takes appropriate action based on the setting of the forceQueue parameter . If it is true the error callback is called on a separate thread . Otherwise it is called right here .