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;
    }
public Dispatchable addEnlistedDispatchableForGlobalTransaction ( int clientXAResourceId , XidProxy xid ) { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "addEnlistedDispatchableForGlobalTransaction" , new Object [ ] { "" + clientXAResourceId } ) ; AbstractFirstLevelMapEntry firstLevelEntry = null ; if ( idToFirstLevelEntryMap . containsKey ( clientXAResourceId ) ) { firstLevelEntry = ( AbstractFirstLevelMapEntry ) idToFirstLevelEntryMap . get ( clientXAResourceId ) ; } GlobalFirstLevelMapEntry entry = null ; if ( firstLevelEntry == null ) { entry = new GlobalFirstLevelMapEntry ( ) ; idToFirstLevelEntryMap . put ( clientXAResourceId , entry ) ; } else { 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.

@param clientXAResourceId Identifies the SIXAResource that the
dispatchable will be used to dispatch work for.
@return the dispatchable to use when ordering work for this unit
of work being performed in the scope of a global transaction.
@see com.ibm.ws.sib.comms.server.clientsupport.ServerTransportReceiveListener#getThreadContext(Conversation, WsByteBuffer, int)