|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.activemq.memory.UsageManager
public class UsageManager
Used to keep track of how much of something is being used so that a productive working set usage can be controlled. Main use case is manage memory usage.
| Constructor Summary | |
|---|---|
UsageManager()
|
|
UsageManager(UsageManager parent)
Create the memory manager linked to a parent. |
|
| Method Summary | |
|---|---|
void |
addUsageListener(UsageListener listener)
|
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 |
getLimit()
|
int |
getPercentUsage()
|
int |
getPercentUsageMinDelta()
|
long |
getUsage()
|
void |
increaseUsage(long value)
Increases the usage by the value amount. |
boolean |
isFull()
|
boolean |
isSendFailIfNoSpace()
|
boolean |
notifyCallbackWhenNotFull(java.lang.Runnable callback)
|
void |
removeUsageListener(UsageListener listener)
|
void |
setLimit(long limit)
Sets the memory limit in bytes. |
void |
setPercentUsageMinDelta(int percentUsageMinDelta)
Sets the minimum number of percentage points the usage has to change before a UsageListener event is fired by the manager. |
void |
setSendFailIfNoSpace(boolean failProducerIfNoSpace)
Sets whether or not a send() should fail if there is no space free. |
java.lang.String |
toString()
|
void |
waitForSpace()
|
boolean |
waitForSpace(long timeout)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public UsageManager()
public UsageManager(UsageManager parent)
parent - | Method Detail |
|---|
public void enqueueUsage(long value)
throws java.lang.InterruptedException
java.lang.InterruptedException
public void waitForSpace()
throws java.lang.InterruptedException
java.lang.InterruptedException
public boolean waitForSpace(long timeout)
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic boolean notifyCallbackWhenNotFull(java.lang.Runnable callback)
callback -
public void increaseUsage(long value)
value - public void decreaseUsage(long value)
value - public boolean isFull()
public void addUsageListener(UsageListener listener)
public void removeUsageListener(UsageListener listener)
public long getLimit()
public void setLimit(long limit)
public int getPercentUsage()
public int getPercentUsageMinDelta()
public void setPercentUsageMinDelta(int percentUsageMinDelta)
percentUsageMinDelta - public long getUsage()
public void setSendFailIfNoSpace(boolean failProducerIfNoSpace)
public boolean isSendFailIfNoSpace()
public java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||