R
- the type of the resource to manage.public class StructRecycler<R extends SossStruct & RecyclableResource & ResourceAllocationValidator> extends ResourceRecycler<R>
ResourceRecycler
for SossStruct
s that can take advantage
of the byte array that backs SossStruct
s and use it as a means of initializing
Structs as they go back into service.Constructor and Description |
---|
StructRecycler(ResourceFactory<R> resourceFactory,
int maxBufferedResources) |
Modifier and Type | Method and Description |
---|---|
R |
getResource()
Return an available resource from the pool, lazily creating a new one if
none are available.
|
int |
getResourceSize() |
releaseResource
public StructRecycler(ResourceFactory<R> resourceFactory, int maxBufferedResources)
public R getResource()
ResourceRecycler
getResource
in class ResourceRecycler<R extends SossStruct & RecyclableResource & ResourceAllocationValidator>
public int getResourceSize()