T - the type of the resource containedpublic interface ScopedResource<T> extends Closeable
Instances are obtained from a ScopedResourcePool such as
ScopedThreadLocal and are expected to be used with the
try-with-resources idiom. The underlying resource is returned to the pool
when close() completes. Clients must not retain a reference to the
resource after the scope ends.
ScopedResourcePool,
ScopedThreadLocal| Modifier and Type | Method and Description |
|---|---|
void |
close()
Signifies the end of the scope and returns the resource to the pool for
use by other acquirers.
|
T |
get()
Get the contained resource
|
T get()
void close()
This method is idempotent; additional invocations have no effect.
close in interface AutoCloseableclose in interface CloseableCopyright © 2026 Chronicle Software Ltd. All rights reserved.