public void enlistSynchronization ( javax . transaction . Synchronization sync ) throws IllegalStateException { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "enlistSynchronization" , sync ) ; /* Dont need this check on sync enlistment if ((_current == null) || (_current.globalTranExists())) { IllegalStateException ise = new IllegalStateException("Cannot enlist Sycnhronization. A Global transaction is active."); FFDCFilter.processException(ise, "com.ibm.tx.ltc.LocalTranCoordImpl.enlistSynchronization", "582", this); Tr.error(tc, "ERR_ENLIST_SYNCH_TX_GLB_ACT"); if (tc.isEntryEnabled()) Tr.exit(tc, "enlistSynchronization", ise); throw ise; } */ if ( ( _state != Running ) && ( _state != Suspended ) ) { final IllegalStateException ise = new IllegalStateException ( "Cannot enlist Synchronization. LocalTransactionCoordinator is completing or completed." ) ; FFDCFilter . processException ( ise , "com.ibm.tx.ltc.LocalTranCoordImpl.enlistSynchronization" , "591" , this ) ; Tr . error ( tc , "ERR_ENLIST_SYNCH_LTC_COMPLETE" ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "enlistSynchronization" , ise ) ; throw ise ; } if ( sync == null ) { final IllegalStateException ise = new IllegalStateException ( "Synchronization enlistment failed. Synchronization specified was null." ) ; FFDCFilter . processException ( ise , "com.ibm.tx.ltc.LocalTranCoordImpl.enlistSynchronization" , "600" , this ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "enlistSynchronization" , ise ) ; throw ise ; } zosSyncChecks ( sync ) ; // Defect 126930 // // If the synchronization is from the container // then we store it seperately so we don't need to // check all enlisted syncs at completion time. // if ( sync instanceof ContainerSynchronization ) { if ( _containerSync != null ) { final String msg = "Enlistment failed. A ContainerSynchronization is already enlisted." ; final IllegalStateException ise = new IllegalStateException ( msg ) ; FFDCFilter . processException ( ise , "com.ibm.tx.ltc.LocalTranCoordImpl.enlistSynchronization" , "618" , this ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "enlistSynchronization" , ise ) ; throw ise ; } _containerSync = ( ContainerSynchronization ) sync ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "ContainerSynchronization Enlisted." ) ; } else { if ( _syncs == null ) { _syncs = new ArrayList < Synchronization > ( ) ; } _syncs . add ( sync ) ; } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "enlistSynchronization" ) ; }
Enlist a Synchronization object that will be informed upon completion of the local transaction containment boundary .