Class PercentLimitUsage<T extends org.apache.activemq.usage.Usage>

java.lang.Object
org.apache.activemq.usage.Usage<T>
org.apache.activemq.usage.PercentLimitUsage<T>
All Implemented Interfaces:
org.apache.activemq.Service
Direct Known Subclasses:
StoreUsage, TempUsage

public abstract class PercentLimitUsage<T extends org.apache.activemq.usage.Usage> extends org.apache.activemq.usage.Usage<T>
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected int
     
    protected long
     

    Fields inherited from class org.apache.activemq.usage.Usage

    name, parent, percentUsage, usageLock, waitForSpaceCondition
  • Constructor Summary

    Constructors
    Constructor
    Description
    PercentLimitUsage(T parent, String name, float portion)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
     
    long
     
    protected void
     
    void
    setPercentLimit(int percentLimit)
     
    void
    setTotal(long max)
    Sets the total available space in bytes.
    protected abstract void
     

    Methods inherited from class org.apache.activemq.usage.Usage

    addChild, addUsageListener, caclPercentUsage, getExecutor, getLimit, getLimiter, getName, getNumUsageListeners, getParent, getPercentUsage, getPercentUsageMinDelta, getPollingTime, getUsage, getUsagePortion, isFull, isFull, isStarted, notifyCallbackWhenNotFull, onLimitChange, removeChild, removeUsageListener, retrieveUsage, setExecutor, setLimit, setLimiter, setName, setParent, setPercentUsage, setPercentUsageMinDelta, setPollingTime, setUsagePortion, start, stop, toString, waitForSpace, waitForSpace, waitForSpace

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • percentLimit

      protected int percentLimit
    • total

      protected long total
  • Constructor Details

    • PercentLimitUsage

      public PercentLimitUsage(T parent, String name, float portion)
      Parameters:
      parent -
      name -
      portion -
  • Method Details

    • setPercentLimit

      public void setPercentLimit(int percentLimit)
    • getPercentLimit

      public int getPercentLimit()
    • setTotal

      public void setTotal(long max)
      Sets the total available space in bytes. When non zero, the filesystem totalAvailableSpace is ignored. When set using Xbean, values of the form "20 Mb", "1024kb", and "1g" can be used
    • getTotal

      public long getTotal()
    • percentLimitFromFile

      protected void percentLimitFromFile(File directory)
    • updateLimitBasedOnPercent

      protected abstract void updateLimitBasedOnPercent()