
rpc.turbo.pool.PoolableObject Maven / Gradle / Ivy
package rpc.turbo.pool;
import stormpot.Poolable;
import stormpot.Slot;
public final class PoolableObject implements Poolable, AutoCloseable {
private final Slot slot;
private final T value;
PoolableObject(Slot slot, T value) {
this.slot = slot;
this.value = value;
}
public T get() {
return value;
}
@Override
public void release() {
slot.release(this);
}
@Override
public void close() throws Exception {
release();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy