|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectariba.util.core.Pool
public class Pool
Generic resource pooling mechanism
Nested Class Summary | |
---|---|
static class |
Pool.PoolChangeReason
Used with poolChange method to indicate the reason the pool was changed. |
Field Summary | |
---|---|
int |
allocationMiss
|
int |
allocationSum
|
int |
allocationWaitTimeSeconds
|
Constructor Summary | |
---|---|
Pool(java.lang.String name)
|
Method Summary | |
---|---|
void |
add(Linkable linkable)
Add a new resource to the pool. |
Linkable |
allocate()
Allocate a resource for our use. |
Linkable |
allocate(java.util.Comparator comparator)
|
Linkable |
allocateIfAny()
Allocate a resource for our use if one is available, otherwise return null. |
Linkable |
allocateIfAvailable(Linkable obj)
Allocate a resource for our use if one is available, otherwise return null. |
boolean |
doWithLock(LockHandlerContext result)
return false to indicate continuation context is allocated by caller to LockHandler.doWithLock and can be used to pass, by reference, any number of result data etc. |
int |
freeCount()
|
int |
inUseCount()
|
void |
release(Linkable linkable)
Release an allocated resource for others to use. |
void |
remove(Linkable linkable)
Remove a resource from the pool. |
int |
size()
|
long |
timeoutIntervalMillis()
the time, in milliseconds, to wait Called WITH LOCK |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public int allocationWaitTimeSeconds
public int allocationSum
public int allocationMiss
Constructor Detail |
---|
public Pool(java.lang.String name)
Method Detail |
---|
public java.lang.String toString()
toString
in class java.lang.Object
public int inUseCount()
public int freeCount()
public int size()
public void add(Linkable linkable)
public void remove(Linkable linkable)
public Linkable allocate()
public boolean doWithLock(LockHandlerContext result)
LockHandlerConditions
doWithLock
in interface LockHandlerConditions
public long timeoutIntervalMillis()
LockHandlerConditions
timeoutIntervalMillis
in interface LockHandlerConditions
public Linkable allocateIfAny()
public Linkable allocateIfAvailable(Linkable obj)
public void release(Linkable linkable)
public Linkable allocate(java.util.Comparator comparator)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |