R - the type of the resource to manage.public class StructRecycler<R extends SossStruct & RecyclableResource & ResourceAllocationValidator> extends ResourceRecycler<R>
ResourceRecycler for SossStructs that can take advantage
of the byte array that backs SossStructs 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() |
releaseResourcepublic StructRecycler(ResourceFactory<R> resourceFactory, int maxBufferedResources)
public R getResource()
ResourceRecyclergetResource in class ResourceRecycler<R extends SossStruct & RecyclableResource & ResourceAllocationValidator>public int getResourceSize()