/** * Marks the object as returning to the pool. * @param pooledObject instance to return to the keyed pool */ protected void markReturningState(final PooledObject<T> pooledObject) { synchronized(pooledObject) { final PooledObjectState state = pooledObject.getState(); if (state != PooledObjectState.ALLOCATED) { throw new IllegalStateException( "Object has already been returned to this pool or is invalid"); } pooledObject.markReturning(); // Keep from being marked abandoned } }
/** * Marks the object as returning to the pool. * @param pooledObject instance to return to the keyed pool */ protected void markReturningState(final PooledObject<T> pooledObject) { synchronized(pooledObject) { final PooledObjectState state = pooledObject.getState(); if (state != PooledObjectState.ALLOCATED) { throw new IllegalStateException( "Object has already been returned to this pool or is invalid"); } pooledObject.markReturning(); // Keep from being marked abandoned } }