public final class GammaObjectPool
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static boolean |
ARRAYLIST_POOLING_ENABLED |
private java.util.ArrayList[] |
arrayListPool |
private int |
arrayListPoolIndex |
private boolean |
arrayListPoolingEnabled |
private static boolean |
CALLABLENODE_POOLING_ENABLED |
private CallableNode[] |
callableNodePool |
private int |
callableNodePoolIndex |
private boolean |
callableNodePoolingEnabled |
private static boolean |
ENABLED |
private int |
lastUsedGammaTxnRef |
private static boolean |
LISTENER_POOLING_ENABLED |
private Listeners[] |
listenersArray |
private static boolean |
LISTENERSARRAY_POOLING_ENABLED |
private boolean |
listenersArrayPoolingEnabled |
private Listeners[] |
listenersPool |
private int |
listenersPoolIndex |
private boolean |
listenersPoolingEnabled |
private static boolean |
TRANLOCAL_POOLING_ENABLED |
private static boolean |
TRANLOCALARRAY_POOLING_ENABLED |
private Tranlocal[][] |
tranlocalArrayPool |
private boolean |
tranlocalArrayPoolingEnabled |
private boolean |
tranlocalPoolingEnabled |
private Tranlocal[] |
tranlocals |
Constructor and Description |
---|
GammaObjectPool() |
Modifier and Type | Method and Description |
---|---|
void |
put(Tranlocal tranlocal)
Puts an old Tranlocal in this pool.
|
void |
putArrayList(java.util.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.
|
java.util.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.
|
private static final boolean ENABLED
private static final boolean TRANLOCAL_POOLING_ENABLED
private static final boolean TRANLOCALARRAY_POOLING_ENABLED
private static final boolean LISTENER_POOLING_ENABLED
private static final boolean LISTENERSARRAY_POOLING_ENABLED
private static final boolean ARRAYLIST_POOLING_ENABLED
private static final boolean CALLABLENODE_POOLING_ENABLED
private final boolean tranlocalPoolingEnabled
private final boolean tranlocalArrayPoolingEnabled
private final boolean listenersPoolingEnabled
private final boolean listenersArrayPoolingEnabled
private final boolean arrayListPoolingEnabled
private final boolean callableNodePoolingEnabled
private final Tranlocal[] tranlocals
private int lastUsedGammaTxnRef
private final Listeners[] listenersPool
private int listenersPoolIndex
private final java.util.ArrayList[] arrayListPool
private int arrayListPoolIndex
private final CallableNode[] callableNodePool
private int callableNodePoolIndex
private Tranlocal[][] tranlocalArrayPool
private Listeners[] listenersArray
public Tranlocal take(BaseGammaTxnRef owner)
owner
- the GammaTxnRef to get the Tranlocal for.java.lang.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.java.lang.NullPointerException
- is array is null.public Tranlocal[] takeTranlocalArray(int size)
size
- the size of the array to takejava.lang.IllegalArgumentException
- if size smaller than 0.public CallableNode takeCallableNode()
public void putCallableNode(CallableNode node)
node
- the CallableNode to pool.java.lang.NullPointerException
- if node is null.public java.util.ArrayList takeArrayList()
public void putArrayList(java.util.ArrayList list)
list
- the ArrayList to place in the pool.java.lang.NullPointerException
- if list is null.public Listeners takeListeners()
public void putListeners(Listeners listeners)
listeners
- the Listeners object to pool.java.lang.NullPointerException
- is listeners is null.public Listeners[] takeListenersArray(int minimalSize)
minimalSize
- the minimalSize of the Listeners array.java.lang.IllegalArgumentException
- if minimalSize is smaller than 0.public void putListenersArray(Listeners[] listenersArray)
listenersArray
- the array to pool.java.lang.NullPointerException
- if listenersArray is null.