- java.lang.Object
-
- jdk.management.resource.SimpleMeter
-
- jdk.management.resource.NotifyingMeter
-
- jdk.management.resource.BoundedMeter
-
- All Implemented Interfaces:
ResourceMeter
,ResourceRequest
@Deprecated(since="10", forRemoval=true) public class BoundedMeter extends NotifyingMeter implements ResourceMeter, ResourceRequest
Deprecated, for removal: This API element is subject to removal in a future version.Resource Management is deprecated for removal with no replacement.A BoundedMeter enforces an upper bound, provides an approver callback for changes and allocates from an optional parent. Approval callbacks occur upon crossing the granularity threshold and when the bound is exceeded; the approval callback occurs before the bounds check. All requests are granted in full or not granted. Requests that are denied are not allocated from the parent.- Since:
- 8u40
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
BoundedMeter(ResourceType type, long bound, ResourceRequest parent, ResourceApprover approver)
Deprecated, for removal: This API element is subject to removal in a future version.Constructor of a BoundedMeter.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static BoundedMeter
create(ResourceType type, long bound)
Deprecated, for removal: This API element is subject to removal in a future version.Returns a new BoundedMeter with the type and upper bound.static BoundedMeter
create(ResourceType type, long bound, ResourceApprover approver)
Deprecated, for removal: This API element is subject to removal in a future version.Returns a new BoundedMeter with the type, upper bound, and approver.static BoundedMeter
create(ResourceType type, long bound, ResourceRequest parent)
Deprecated, for removal: This API element is subject to removal in a future version.Returns a new BoundedMeter with the type, upper bound, and parent.static BoundedMeter
create(ResourceType type, long bound, ResourceRequest parent, ResourceApprover approver)
Deprecated, for removal: This API element is subject to removal in a future version.Returns a new BoundedMeter with the type, upper bound, parent, and approver.long
getBound()
Deprecated, for removal: This API element is subject to removal in a future version.Returns the upper bound for the meter.long
setBound(long bound)
Deprecated, for removal: This API element is subject to removal in a future version.Sets the bound.-
Methods declared in class jdk.management.resource.NotifyingMeter
create, create, getApprover, getGranularity, setGranularity, validate
-
Methods declared in class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods declared in interface jdk.management.resource.ResourceMeter
getAllocated, getType, getValue
-
Methods declared in interface jdk.management.resource.ResourceRequest
request
-
-
-
-
Constructor Detail
-
BoundedMeter
protected BoundedMeter(ResourceType type, long bound, ResourceRequest parent, ResourceApprover approver)
Deprecated, for removal: This API element is subject to removal in a future version.Constructor of a BoundedMeter.- Parameters:
type
- the ResourceType of the meterbound
- the initial upper boundparent
- a ResourceRequest to request from; may benull
approver
- the ResourceApprover to be notified; may benull
-
-
Method Detail
-
create
public static BoundedMeter create(ResourceType type, long bound)
Deprecated, for removal: This API element is subject to removal in a future version.Returns a new BoundedMeter with the type and upper bound.- Parameters:
type
- the ResourceTypebound
- the upper bound; must be zero or greater- Returns:
- a new BoundedMeter with the type and bound
- Throws:
IllegalArgumentException
- if the bound is less than zero
-
create
public static BoundedMeter create(ResourceType type, long bound, ResourceRequest parent)
Deprecated, for removal: This API element is subject to removal in a future version.Returns a new BoundedMeter with the type, upper bound, and parent.- Parameters:
type
- the ResourceTypebound
- the upper bound; must be zero or greaterparent
- a ResourceRequest to request from; may benull
- Returns:
- a new BoundedMeter with the type, bound, and parent approver
- Throws:
IllegalArgumentException
- if the bound is less than zero
-
create
public static BoundedMeter create(ResourceType type, long bound, ResourceRequest parent, ResourceApprover approver)
Deprecated, for removal: This API element is subject to removal in a future version.Returns a new BoundedMeter with the type, upper bound, parent, and approver.- Parameters:
type
- the ResourceTypebound
- the upper bound; must be zero or greaterparent
- a ResourceRequest to request from; may benull
approver
- the ResourceApprover to be notified; may benull
- Returns:
- a new BoundedMeter with the type, bound, parent, and approver
- Throws:
IllegalArgumentException
- if the bound is less than zero
-
create
public static BoundedMeter create(ResourceType type, long bound, ResourceApprover approver)
Deprecated, for removal: This API element is subject to removal in a future version.Returns a new BoundedMeter with the type, upper bound, and approver.- Parameters:
type
- the ResourceTypebound
- the upper bound; must be zero or greaterapprover
- the ResourceApprover to be notified; may benull
- Returns:
- a new BoundedMeter with the type, bound, parent, and approver
- Throws:
IllegalArgumentException
- if the bound is less than zero
-
getBound
public final long getBound()
Deprecated, for removal: This API element is subject to removal in a future version.Returns the upper bound for the meter.- Returns:
- the upper bound
-
setBound
public final long setBound(long bound)
Deprecated, for removal: This API element is subject to removal in a future version.Sets the bound.- Parameters:
bound
- the bound; must be zero or greater- Returns:
- the previous upper bound
- Throws:
IllegalArgumentException
- if the bound is less than zero
-
-