|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.sadun.util.pool.ObjectPool.BaseFactory
A base implementation of ExtendedObjectPool.Factory
relying on reflection, holding a Class object, an optional parameter array
and an optional Setup
object.
These objects are made available to subclasses by the members cls
,
params
and ps
.
Field Summary | |
protected java.lang.Class |
cls
The class of the objects produced by the factory. |
protected java.lang.Class[] |
paramCls
The types of the parameters to use for constructing the object. |
protected java.lang.Object[] |
params
The parameters to use for constructing the object. |
protected Setup |
ps
The setup object to use for post-construction initialization. |
Constructor Summary | |
ObjectPool.BaseFactory(java.lang.Class cls,
java.lang.Object[] params,
Setup ps)
Create a BaseFactory whose member cls will hold the class of the objects to produce |
|
ObjectPool.BaseFactory(java.lang.String clsName,
java.lang.Object[] params,
Setup ps)
Create a BaseFactory whose member cls will hold the class of the objects to produce |
Method Summary | |
abstract java.lang.Object |
create()
Subclasses must implement the code which actually creates a new instance of the class to pool. |
void |
destroy(java.lang.Object obj)
A null implementation of ObjectPool.Factory.destroy() . |
java.lang.Class |
getProducedClass()
Return the class object for the type of object this factory creates |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.lang.Class cls
protected java.lang.Object[] params
protected Setup ps
protected java.lang.Class[] paramCls
Constructor Detail |
public ObjectPool.BaseFactory(java.lang.Class cls, java.lang.Object[] params, Setup ps)
cls
will hold the class of the objects to produce
cls
- the class of the objects to produceparams
- the construction parameters, or nullps
- the Setup
object to be used for post-construction setup, or nullpublic ObjectPool.BaseFactory(java.lang.String clsName, java.lang.Object[] params, Setup ps)
cls
will hold the class of the objects to produce
clsName
- the name of the class of the objects to produceparams
- the construction parameters, or nullps
- the Setup
object to be used for post-construction setup, or nullMethod Detail |
public abstract java.lang.Object create()
create
in interface ObjectPool.Factory
public void destroy(java.lang.Object obj)
ObjectPool.Factory.destroy()
.
destroy
in interface ObjectPool.Factory
obj
- the object to destroypublic java.lang.Class getProducedClass()
getProducedClass
in interface ObjectPool.Factory
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |