All Downloads are FREE. Search and download functionalities are using the official Maven repository.

rpc.turbo.pool.PoolableObject Maven / Gradle / Ivy

There is a newer version: 0.0.9
Show newest version
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