org.huihoo.jfox.pool
Class AbstractObjectPool
org.huihoo.jfox.service.ComponentSupport
|
+--org.huihoo.jfox.pool.AbstractObjectPool
- All Implemented Interfaces:
- Component, ComponentSupportMBean, Loggable, ObjectPool, ObjectPoolMBean, Persistentable, java.io.Serializable
- Direct Known Subclasses:
- SimpleObjectPool
- public abstract class AbstractObjectPool
- extends ComponentSupport
- implements ObjectPool
the supper class of all object pool
- Author:
- Young Yang
- See Also:
- Serialized Form
|
Method Summary |
void |
clear()
Clears any objects sitting idle in the pool, releasing any associated resources |
protected void |
doDestroy()
do actually destory action |
protected void |
doInit()
do actually create action |
java.lang.String |
getObjectClass()
get the pooled object's class type, it return by object pool's factory |
ObjectFactory |
getObjectFactory()
get the factory use to create new instances |
int |
getRest()
get the count of rest object |
int |
getWorking()
get the count of working object |
| Methods inherited from class org.huihoo.jfox.service.ComponentSupport |
destroy, getLogger, getName, getObjectName, getProxyInstance, getState, handleNotification, init, parseName, postDeregister, postRegister, preDeregister, preRegister, setLogger, setName |
factory
protected ObjectFactory factory
AbstractObjectPool
public AbstractObjectPool(ObjectFactory factory)
AbstractObjectPool
public AbstractObjectPool(java.lang.String objectFactoryClassName,
java.lang.String poolableClassName)
getObjectFactory
public ObjectFactory getObjectFactory()
- Description copied from interface:
ObjectPoolMBean
- get the factory use to create new instances
- Specified by:
getObjectFactory in interface ObjectPoolMBean
getObjectClass
public java.lang.String getObjectClass()
- get the pooled object's class type, it return by object pool's factory
- Specified by:
getObjectClass in interface ObjectPoolMBean
- Returns:
-
clear
public void clear()
- Clears any objects sitting idle in the pool, releasing any associated resources
- Specified by:
clear in interface ObjectPoolMBean
doInit
protected void doInit()
throws java.lang.Exception
- Description copied from class:
ComponentSupport
- do actually create action
- Overrides:
doInit in class ComponentSupport
doDestroy
protected void doDestroy()
throws java.lang.Exception
- Description copied from class:
ComponentSupport
- do actually destory action
- Overrides:
doDestroy in class ComponentSupport
getWorking
public int getWorking()
- get the count of working object
- Specified by:
getWorking in interface ObjectPoolMBean
- Returns:
-
getRest
public int getRest()
- get the count of rest object
- Specified by:
getRest in interface ObjectPoolMBean
- Returns:
-