final int registerXAResourceInfo(EmbeddableWebSphereTransactionManager tm,
                                     CommonXAResourceInfo xaResourceInfo, int commitPriority, String qmid) {
        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
        if (isTraceOn && tc.isEntryEnabled())
            Tr.entry(tc, "registerXAResourceInfo");
        // Transaction service will use the filter we provide to query the service registry for an XAResourceFactory.
        // If possible, filter on the JNDI name because the id field is optional (in which case cfKey defaults to the JNDI name)
        // and any generated unique identifier (config.id) might not be consistent across server restarts.
        // In the case of app-defined resources (@DataSourceDefinition), however, the JNDI name is not guaranteed to be unique,
        // and so the unique identifer (which for app-defined resources is always specified) must be used instead.
        CMConfigDataImpl cmConfigData = (CMConfigDataImpl) (xaResourceInfo != null ? xaResourceInfo.getCmConfig() : this.cmConfig);
        String id = cmConfigData.getCfKey();
        String jndiName = cmConfigData.getJNDIName();
        String filter;
        if (jndiName == null || id.startsWith(AppDefinedResource.PREFIX))
            filter = FilterUtils.createPropertyFilter("config.displayId", id);
        else
            filter = FilterUtils.createPropertyFilter(ResourceFactory.JNDI_NAME, jndiName);

        // Pre-serialize resource info so that the transactions bundle can deserialize
        // back to the pre-serialized form without without having access to classes in our bundle.
        // Need to use List<Byte> instead of byte[] because XARecoveryWrapper does a shallow compare. Icck.
        ArrayList<Byte> resInfo;
        try {
            if (qmid != null)
                cmConfigData.setQmid(qmid);
            byte[] bytes = CommonFunction.serObjByte(cmConfigData);
            resInfo = new ArrayList<Byte>(bytes.length);
            for (byte b : bytes)
                resInfo.add(b);
        } catch (IOException x) {
            FFDCFilter.processException(x, getClass().getName(), "581", new Object[] { xaResourceInfo.getCmConfig() });
            throw new IllegalArgumentException(x);
        }

        int recoveryToken = tm.registerResourceInfo(filter, resInfo, commitPriority);
        if (isTraceOn && tc.isEntryEnabled())
            Tr.exit(tc, "registerXAResourceInfo");

        return recoveryToken;
    }
final int registerXAResourceInfo ( EmbeddableWebSphereTransactionManager tm , CommonXAResourceInfo xaResourceInfo , int commitPriority , String qmid ) { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "registerXAResourceInfo" ) ; CMConfigDataImpl cmConfigData = ( CMConfigDataImpl ) ( xaResourceInfo != null ? xaResourceInfo . getCmConfig ( ) : this . cmConfig ) ; String id = cmConfigData . getCfKey ( ) ; String jndiName = cmConfigData . getJNDIName ( ) ; String filter ; if ( jndiName == null || id . startsWith ( AppDefinedResource . PREFIX ) ) filter = FilterUtils . createPropertyFilter ( "config.displayId" , id ) ; else filter = FilterUtils . createPropertyFilter ( ResourceFactory . JNDI_NAME , jndiName ) ; ArrayList < Byte > resInfo ; try { if ( qmid != null ) cmConfigData . setQmid ( qmid ) ; byte [ ] bytes = CommonFunction . serObjByte ( cmConfigData ) ; resInfo = new ArrayList < Byte > ( bytes . length ) ; for ( byte b : bytes ) resInfo . add ( b ) ; } catch ( IOException x ) { FFDCFilter . processException ( x , getClass ( ) . getName ( ) , "581" , new Object [ ] { xaResourceInfo . getCmConfig ( ) } ) ; throw new IllegalArgumentException ( x ) ; } int recoveryToken = tm . registerResourceInfo ( filter , resInfo , commitPriority ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "registerXAResourceInfo" ) ; return recoveryToken ; }
Register XA resource information with the transaction manager.

@param tm the transaction manager.
@param xaResourceInfo information necessary for producing an XAResource object using the XAResourceFactory.
@param commitPriority priority to use when committing multiple XA resources.
@return the recovery ID (or -1 if an error occurs)