org.apache.activemq.usage
public class MemoryUsage extends Usage<MemoryUsage>
name, parent, percentUsage, usageMutex
Constructor and Description |
---|
MemoryUsage() |
MemoryUsage(MemoryUsage parent)
Create the memory manager linked to a parent.
|
MemoryUsage(MemoryUsage parent,
java.lang.String name) |
MemoryUsage(MemoryUsage parent,
java.lang.String name,
float portion) |
MemoryUsage(java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
void |
decreaseUsage(long value)
Decreases the usage by the value amount.
|
void |
enqueueUsage(long value)
Tries to increase the usage by value amount but blocks if this object is
currently full.
|
long |
getUsage() |
void |
increaseUsage(long value)
Increases the usage by the value amount.
|
boolean |
isFull() |
protected long |
retrieveUsage() |
void |
setUsage(long usage) |
void |
waitForSpace() |
boolean |
waitForSpace(long timeout) |
addChild, addUsageListener, caclPercentUsage, getExecutor, getLimit, getLimiter, getName, getParent, getPercentUsage, getPercentUsageMinDelta, getPollingTime, getUsagePortion, isFull, notifyCallbackWhenNotFull, onLimitChange, removeChild, removeUsageListener, setExecutor, setLimit, setLimiter, setName, setParent, setPercentUsage, setPercentUsageMinDelta, setPollingTime, setUsagePortion, start, stop, toString, waitForSpace
public MemoryUsage()
public MemoryUsage(MemoryUsage parent)
parent
- public MemoryUsage(java.lang.String name)
public MemoryUsage(MemoryUsage parent, java.lang.String name)
public MemoryUsage(MemoryUsage parent, java.lang.String name, float portion)
public void waitForSpace() throws java.lang.InterruptedException
waitForSpace
in class Usage<MemoryUsage>
java.lang.InterruptedException
public boolean waitForSpace(long timeout) throws java.lang.InterruptedException
waitForSpace
in class Usage<MemoryUsage>
timeout
- java.lang.InterruptedException
public boolean isFull()
isFull
in class Usage<MemoryUsage>
public void enqueueUsage(long value) throws java.lang.InterruptedException
value
- java.lang.InterruptedException
public void increaseUsage(long value)
value
- public void decreaseUsage(long value)
value
- protected long retrieveUsage()
retrieveUsage
in class Usage<MemoryUsage>
public long getUsage()
getUsage
in class Usage<MemoryUsage>
public void setUsage(long usage)
Copyright © 2005-2014. All Rights Reserved.