|
Project JXTA | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ResourceAccount
| Method Summary | |
|---|---|
void |
close()
Tear down this account. |
long |
getNbReserved()
Returns the number of reserved items that can still be obtained by this account. |
Object |
getUserObject()
|
void |
inNeed(boolean needs)
Call this with true as soon as this account needs a new item. |
boolean |
isIdle()
Tells if this account is idle (that is, none of the resources that it controls are currently in use). |
boolean |
obtainItem()
Try and grant a new item to this account. |
boolean |
obtainQuantity(long quantity)
Try and grant a certain quantity. |
ResourceAccount |
releaseItem()
This will release an item and return the most eligible account to re-use this item for. |
void |
releaseQuantity(long quantity)
This will release a number of items at once rather than once. |
void |
setUserObject(Object obj)
Set the userObject associated with that account. |
| Method Detail |
|---|
void close()
boolean obtainItem()
boolean obtainQuantity(long quantity)
quantity - The number of units wanted. The unit is arbitrary
It is only meaningfull to the code that uses this dispatcher.
ResourceAccount releaseItem()
void releaseQuantity(long quantity)
quantity - the number of items to be released.void inNeed(boolean needs)
needs - Whether the account needs a new item or not.Object getUserObject()
void setUserObject(Object obj)
long getNbReserved()
boolean isIdle()
|
JXTA J2SE | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||