|
Jamaica 6.1 release 1
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.aicas.jamaica.lang.AllocationHandler
com.aicas.jamaica.lang.MemoryBudget
public abstract class MemoryBudget
MemoryBudget is a class that provides to equip a thread with a certain memory allocation budget. After the budget is exceeded, the thread will no longer succeed in any allocations that it does.
| Constructor Summary | |
|---|---|
MemoryBudget(Thread t,
long budget)
Add a budget for a given thread |
|
| Method Summary | |
|---|---|
boolean |
allocationPermitted()
Is allocation within thread() still permitted? |
void |
allowAllocation()
Permit allocation for this thread. |
long |
budget()
Get the budget of a given thread |
abstract void |
budgetEmpty()
Handler routine that is called when the budget of a certain thread is exhausted. |
void |
destroy()
Remove this memory budget from thread(). |
void |
forbidAllocation()
Forbid allocation for this thread. |
Object |
handle(Object o)
Routine that will be called when a thread allocated an object. |
Thread |
thread()
The thread this budget is assigned to |
long |
usedBudget()
Get the used budget of a given thread |
| Methods inherited from class com.aicas.jamaica.lang.AllocationHandler |
|---|
removeAllocationHandler, setAllocationHandler |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MemoryBudget(Thread t,
long budget)
t - the threadbudget - the budget in bytes| Method Detail |
|---|
public long budget()
public long usedBudget()
public Thread thread()
public boolean allocationPermitted()
public final Object handle(Object o)
handle in class AllocationHandlero - the allocated object
public void forbidAllocation()
public void allowAllocation()
public abstract void budgetEmpty()
public void destroy()
|
Jamaica 6.1 release 1
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||