private static void invokeCallback ( SICoreConnection conn , ConsumerSession session , // d172528 Exception exception , int eventId ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "invokeCallback" , new Object [ ] { conn , session , exception , eventId } ) ; if ( conn != null ) // f174318 { // f174318 try { final AsyncCallbackSynchronizer asyncCallbackSynchronizer = ( ( ConnectionProxy ) conn ) . getAsyncCallbackSynchronizer ( ) ; SICoreConnectionListener [ ] myListeners = conn . getConnectionListeners ( ) ; for ( int x = 0 ; x < myListeners . length ; x ++ ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Invoking callback on: " + myListeners [ x ] ) ; // Obtain permission from the callback synchronizer to call the application asyncCallbackSynchronizer . enterAsyncExceptionCallback ( ) ; // start f174318 try { switch ( eventId ) { // This special event ID will not be received across the wire, but will // be used internally when we get notified of a JFAP error. case ( 0x0000 ) : myListeners [ x ] . commsFailure ( conn , ( SIConnectionLostException ) exception ) ; break ; case ( CommsConstants . EVENTID_ME_QUIESCING ) : // f179464 myListeners [ x ] . meQuiescing ( conn ) ; break ; case ( CommsConstants . EVENTID_ME_TERMINATED ) : // f179464 myListeners [ x ] . meTerminated ( conn ) ; // f179464 break ; // f179464 case ( CommsConstants . EVENTID_ASYNC_EXCEPTION ) : // d172528 // f179464 myListeners [ x ] . asynchronousException ( session , exception ) ; // d172528 break ; // d172528 default : // Should never happen if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Invalid event ID: " + eventId ) ; break ; } } catch ( Exception e ) { FFDCFilter . processException ( e , CLASS_NAME + ".invokeCallback" , CommsConstants . CLIENTASYNCHEVENTTHREADPOOL_INVOKE_01 , new Object [ ] { myListeners [ x ] , conn , session , exception , "" + eventId } ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Caught an exception from the callback" , e ) ; } finally { // Tell the callback synchronizer that we have completed the exception callback asyncCallbackSynchronizer . exitAsyncExceptionCallback ( ) ; } // end f174318 } // f174318 } catch ( SIException e ) { // No FFDC Code needed // We couldn't get hold of the connection listeners for some reason. Not a lot we can // do here except debug the failure if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Unable to get connection listeners" , e ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "invokeCallback" ) ; }
This method will send a message to the connection listeners associated with this connection .