public Dispatchable addEnlistedDispatchableForGlobalTransaction ( int clientXAResourceId , XidProxy xid ) { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "addEnlistedDispatchableForGlobalTransaction" , new Object [ ] { "" + clientXAResourceId } ) ; AbstractFirstLevelMapEntry firstLevelEntry = null ; // Locate the first level map entry - if there is one. if ( idToFirstLevelEntryMap . containsKey ( clientXAResourceId ) ) { firstLevelEntry = ( AbstractFirstLevelMapEntry ) idToFirstLevelEntryMap . get ( clientXAResourceId ) ; } GlobalFirstLevelMapEntry entry = null ; if ( firstLevelEntry == null ) { // If there is no first level map entry for this SIXAResource - create one entry = new GlobalFirstLevelMapEntry ( ) ; idToFirstLevelEntryMap . put ( clientXAResourceId , entry ) ; } else { // This SIXAResource has already particiapted in work - as there is already // an instance - check that it isn't for a local transaction (which would // indicate a programming error). if ( firstLevelEntry . isLocalTransaction ( ) ) { final SIErrorException exception = new SIErrorException ( CommsConstants . TRANTODISPATCHMAP_ADDENLISTEDGLOBALTX_01 ) ; FFDCFilter . processException ( exception , CLASS_NAME + ".addEnlistedDispatchableForGlobalTransaction" , CommsConstants . TRANTODISPATCHMAP_ADDENLISTEDGLOBALTX_01 , new Object [ ] { "" + clientXAResourceId , idToFirstLevelEntryMap , this } ) ; if ( tc . isEventEnabled ( ) ) SibTr . exception ( this , tc , exception ) ; throw exception ; } entry = ( GlobalFirstLevelMapEntry ) firstLevelEntry ; } final Dispatchable result = entry . createNewEnlistedDispatchable ( xid ) ; if ( tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "addEnlistedDispatchableForGlobalTransaction" , result ) ; return result ; }
Adds a dispatchable for use with a specific SIXAResource which is currently enlisted in a global transaction . Typically this is done by the TCP channel thread when it determines that it is about to pass the transmission relating to the XA_START of enlistment into a global transaction to the receive listener dispatcher .