public abstract class AbstractThreadLocalRecyclableFactory<T> extends java.lang.Object implements RecyclableFactory<T>
Constructor and Description |
---|
AbstractThreadLocalRecyclableFactory() |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
cleanUp(T obj)
reset this object to its clean state
|
protected java.util.List<T> |
getRecycleBin() |
int |
getRecycleBinSize() |
protected abstract T |
instantiate(java.lang.Object... params)
instantiate a new T
|
T |
newInstance(java.lang.Object... params) |
void |
recycle(T obj) |
protected void |
release(T obj)
called if we are just going to release this to GC.
|
void |
setRecycleBinSize(int size) |
public AbstractThreadLocalRecyclableFactory()
public T newInstance(java.lang.Object... params)
newInstance
in interface RecyclableFactory<T>
public void recycle(T obj)
recycle
in interface RecyclableFactory<T>
public int getRecycleBinSize()
getRecycleBinSize
in interface RecyclableFactory<T>
public void setRecycleBinSize(int size)
setRecycleBinSize
in interface RecyclableFactory<T>
protected abstract void cleanUp(T obj)
obj
- protected void release(T obj)
obj
- protected abstract T instantiate(java.lang.Object... params)
protected java.util.List<T> getRecycleBin()