public void checkin ( AdminClient client ) { if ( isClosed . get ( ) ) { throw new IllegalStateException ( "Pool is closing" ) ; } if ( client == null ) { throw new IllegalArgumentException ( "client is null" ) ; } boolean isCheckedIn = clientCache . offer ( client ) ; if ( ! isCheckedIn ) { // Cache is already full, close this AdminClient client . close ( ) ; } }
submit the adminClient after usage is completed . Behavior is undefined if checkin is called with objects not retrieved from checkout .