public synchronized Object getInstanceIfFree ( ) { // Check if the pool is empty. if ( ! freeStack . isEmpty ( ) ) { // Remove object from end of free pool. Object result = freeStack . remove ( freeStack . size ( ) - 1 ) ; return result ; } return null ; }
Get an instance of the given object in this pool if available