Class 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 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 meter
        bound - the initial upper bound
        parent - a ResourceRequest to request from; may be null
        approver - the ResourceApprover to be notified; may be null
    • 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 ResourceType
        bound - 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 ResourceType
        bound - the upper bound; must be zero or greater
        parent - a ResourceRequest to request from; may be null
        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 ResourceType
        bound - the upper bound; must be zero or greater
        parent - a ResourceRequest to request from; may be null
        approver - the ResourceApprover to be notified; may be null
        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 ResourceType
        bound - the upper bound; must be zero or greater
        approver - the ResourceApprover to be notified; may be null
        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