protected void removeCleanupAndDestroyAllFreeConnections ( ) { // removed iterator code // This method is called within a synchronize block if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( this , tc , "removeCleanupAndDestroyAllFreeConnections" ) ; } int mcWrapperListIndex = mcWrapperList . size ( ) - 1 ; for ( int i = mcWrapperListIndex ; i >= 0 ; -- i ) { MCWrapper mcw = ( MCWrapper ) mcWrapperList . remove ( i ) ; mcw . setPoolState ( 0 ) ; -- numberOfConnectionsAssignedToThisFreePool ; cleanupAndDestroyMCWrapper ( mcw ) ; pm . totalConnectionCount . decrementAndGet ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( this , tc , "removeCleanupAndDestroyAllFreeConnections" ) ; } }
Remove the mcWrappers from the arraylist . Cleanup and destroy the managed connections .