-
- All Known Implementing Classes:
BoundedMeter
,NotifyingMeter
,SimpleMeter
,ThrottledMeter
public interface ResourceMeter
A resource meter with a current value and a ResourceType. Refer to the concrete meter subtypes for additional useful semantics. The meter has a current value that tracks net allocations and releases and a count of cumulative allocations and counts only allocations. Meter behavior can be extended or customized by subclassing the concrete implementations or implementing this interface.- Since:
- 8u40
- See Also:
SimpleMeter
,NotifyingMeter
,BoundedMeter
,ThrottledMeter
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description long
getAllocated()
Returns the cumulative total of allocations from the ResourceMeter.ResourceType
getType()
Returns theResourceType
.long
getValue()
Returns the current net value of the ResourceMeter.
-
-
-
Method Detail
-
getValue
long getValue()
Returns the current net value of the ResourceMeter. The net value is the difference between the cumulative amounts allocated minus all amounts released.- Returns:
- the current net value of the meter
-
getAllocated
long getAllocated()
Returns the cumulative total of allocations from the ResourceMeter.- Returns:
- the total allocated from the meter
-
getType
ResourceType getType()
Returns theResourceType
.- Returns:
- the ResourceType
-
-