private void checkForConnectionInFreePool ( MCWrapper mcw ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( this , tc , "checkForConnectionInFreePool" ) ; } int hashMapBucket = mcw . getHashMapBucket ( ) ; /* * Attempt to remove the mcw from the free pool */ if ( freePool [ hashMapBucket ] . removeMCWrapperFromList ( mcw ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( this , tc , "Managed connection wrapper was removed from the free pool wrapper list. mcw is " + mcw ) ; } /* * The connection was in the free pool, cleaup and destroy the mc. */ freePool [ hashMapBucket ] . cleanupAndDestroyMCWrapper ( mcw ) ; /* * Finish the work needed in the free pool for this mcw. * * Parms on the removeMCWrapperFromList are: * MCWrapper object = mcw * removeFromFreePool = false (we alread removed the connection) * synchronizationNeeded = true (we are not sync'ed, so the method will need to sync) * skipWaiterNotify = false (if there are waiters, we should wake-up one of them) * decrementTotalCounter = true (if we are going to wake-up a waiter, we need to allow * the waiter to create a connection if total is at its max) */ freePool [ hashMapBucket ] . removeMCWrapperFromList ( mcw , false , true , false , true ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( this , tc , "checkForConnectionInFreePool" ) ; } }
Check for a connection in the free pool . If a connection is found cleanup and destroy the connection and remove the mcwrapper from the free pool .