T - the type of the contained resourcepublic class StrongReferenceScopedResource<T> extends Object
ScopedResource that always keeps a strong reference to its
resource. The object therefore remains reachable until
closeResource() is called. In contrast to
WeakReferenceScopedResource, the reference is never cleared when the
scope ends.| 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.
|
void |
closeResource()
Close the contained resource and clear any references.
|
T |
get()
Get the contained resource
|
long |
getCreatedTimeNanos()
The time this resource was created
|
Class<?> |
getType()
Get the type of object contained, may return null
|
public T get()
ScopedResourcepublic void closeResource()
Called when a resource is permanently discarded from the pool or when the thread-local stack is closed.
Implementations should release all state and must be idempotent.
public Class<?> getType()
public void close()
ScopedResourceThis method is idempotent; additional invocations have no effect.
close in interface Closeableclose in interface AutoCloseableclose in interface ScopedResource<T>public long getCreatedTimeNanos()
System.nanoTime() of creationCopyright © 2026 Chronicle Software Ltd. All rights reserved.