Package org.apache.activemq.usage
Class PercentLimitUsage<T extends Usage>
- java.lang.Object
-
- org.apache.activemq.usage.Usage<T>
-
- org.apache.activemq.usage.PercentLimitUsage<T>
-
- All Implemented Interfaces:
Service
- Direct Known Subclasses:
StoreUsage
,TempUsage
public abstract class PercentLimitUsage<T extends Usage> extends Usage<T>
-
-
Field Summary
Fields Modifier and Type Field Description protected int
percentLimit
protected long
total
-
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
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description int
getPercentLimit()
long
getTotal()
protected void
percentLimitFromFile(File directory)
void
setPercentLimit(int percentLimit)
void
setTotal(long max)
Sets the total available space in bytes.protected abstract void
updateLimitBasedOnPercent()
-
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
-
-
-
-
Method Detail
-
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()
-
-