|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.multiverse.stms.gamma.GammaObjectPool
public final class GammaObjectPool
A pool for tranlocals. The pool is not threadsafe and should be connected to a thread (can be stored in a threadlocal). Eventually the performance of the stm will be limited to the rate of cleanup, and using a pool seriously improves scalability.
Improvement: atm there is only one single type of tranlocal. If there are more types of tranlocals, each class needs to have an index. This index can be used to determine the type of ref. If the pool contains an array of arrays, where the first array is index based on the type of the ref, finding the second array (that contains pooled tranlocals) can be found easily. ObjectPool is not thread safe and should not be shared between threads. This class is generated.
| Constructor Summary | |
|---|---|
GammaObjectPool()
|
|
| Method Summary | |
|---|---|
void |
put(Tranlocal tranlocal)
Puts an old Tranlocal in this pool. |
void |
putArrayList(ArrayList list)
Puts an ArrayList in this pool. |
void |
putCallableNode(CallableNode node)
Puts a CallableNode in the pool. |
void |
putListeners(Listeners listeners)
Puts a Listeners object in the pool. |
void |
putListenersArray(Listeners[] listenersArray)
Puts a Listeners array in the pool. |
void |
putTranlocalArray(Tranlocal[] array)
Puts a GammaTranlocal array in the pool. |
Tranlocal |
take(BaseGammaTxnRef owner)
Takes a Tranlocal from the pool for the specified GammaTxnRef. |
ArrayList |
takeArrayList()
Takes an ArrayList from the pool, The returned ArrayList is cleared. |
CallableNode |
takeCallableNode()
Takes a CallableNode from the pool, or null if none is available. |
Listeners |
takeListeners()
Takes a Listeners object from the pool. |
Listeners[] |
takeListenersArray(int minimalSize)
Takes a Listeners array from the pool. |
Tranlocal[] |
takeTranlocalArray(int size)
Takes a tranlocal array from the pool with the given size. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public GammaObjectPool()
| Method Detail |
|---|
public Tranlocal take(BaseGammaTxnRef owner)
owner - the GammaTxnRef to get the Tranlocal for.
NullPointerException - if owner is null.public void put(Tranlocal tranlocal)
tranlocal - the Tranlocal to pool.public void putTranlocalArray(Tranlocal[] array)
array - the GammaTranlocal array to put in the pool.
NullPointerException - is array is null.public Tranlocal[] takeTranlocalArray(int size)
size - the size of the array to take
IllegalArgumentException - if size smaller than 0.public CallableNode takeCallableNode()
public void putCallableNode(CallableNode node)
node - the CallableNode to pool.
NullPointerException - if node is null.public ArrayList takeArrayList()
public void putArrayList(ArrayList list)
list - the ArrayList to place in the pool.
NullPointerException - if list is null.public Listeners takeListeners()
public void putListeners(Listeners listeners)
listeners - the Listeners object to pool.
NullPointerException - is listeners is null.public Listeners[] takeListenersArray(int minimalSize)
minimalSize - the minimalSize of the Listeners array.
IllegalArgumentException - if minimalSize is smaller than 0.public void putListenersArray(Listeners[] listenersArray)
listenersArray - the array to pool.
NullPointerException - if listenersArray is null.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||