public class TimerPool extends ResourcePool
ResourcePool
for managing a
pool of IntervalTimer
s.Constructor and Description |
---|
TimerPool(int size)
Construct a new
TimerPool of the specified size. |
Modifier and Type | Method and Description |
---|---|
protected Resource |
constructResource()
Construct a new
IntervalTimer . |
void |
releaseTimer(IntervalTimer timer)
Release a timer back into the pool.
|
IntervalTimer |
reserveTimer()
Reserve a timer from the pool.
|
getAvailableResourceCount, getTotalResourceCount, getUsedResourceCount, releaseResource, reserveResource
public TimerPool(int size)
TimerPool
of the specified size.size
- The number of IntervalTimer
s to preallocate.protected Resource constructResource()
IntervalTimer
.constructResource
in class ResourcePool
IntervalTimer
.public IntervalTimer reserveTimer()
IntervalTimer
instance.public void releaseTimer(IntervalTimer timer)
timer
- The timer to release.WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses