org.huihoo.jfox.pool
Class ObjectPoolSupport

java.lang.Object
  extended byorg.huihoo.jfox.system.ComponentSupport
      extended byorg.huihoo.jfox.pool.ObjectPoolSupport
All Implemented Interfaces:
Component, Loggable, ObjectPool, Persistentable, java.io.Serializable
Direct Known Subclasses:
SimpleObjectPool

public abstract class ObjectPoolSupport
extends ComponentSupport
implements ObjectPool

the supper class of all object pool

See Also:
Serialized Form

Field Summary
protected  ObjectFactory factory
           
 
Fields inherited from class org.huihoo.jfox.system.ComponentSupport
logger, name, proxyInstance, sequence, state
 
Constructor Summary
ObjectPoolSupport(ObjectFactory factory)
           
ObjectPoolSupport(java.lang.String objectFactoryClassName, java.lang.String poolableClassName)
           
 
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.system.ComponentSupport
destroy, getLogger, getName, getState, init, parseName, setLogger, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.huihoo.jfox.pool.ObjectPool
removeObject, restoreObject, retrieveObject
 

Field Detail

factory

protected ObjectFactory factory
Constructor Detail

ObjectPoolSupport

public ObjectPoolSupport(ObjectFactory factory)

ObjectPoolSupport

public ObjectPoolSupport(java.lang.String objectFactoryClassName,
                         java.lang.String poolableClassName)
Method Detail

getObjectFactory

public ObjectFactory getObjectFactory()
Description copied from interface: ObjectPool
get the factory use to create new instances

Specified by:
getObjectFactory in interface ObjectPool

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 ObjectPool
Returns:

clear

public void clear()
Clears any objects sitting idle in the pool, releasing any associated resources

Specified by:
clear in interface ObjectPool

doInit

protected void doInit()
               throws java.lang.Exception
Description copied from class: ComponentSupport
do actually create action

Specified by:
doInit in class ComponentSupport
Throws:
java.lang.Exception

doDestroy

protected void doDestroy()
                  throws java.lang.Exception
Description copied from class: ComponentSupport
do actually destory action

Specified by:
doDestroy in class ComponentSupport
Throws:
java.lang.Exception

getWorking

public int getWorking()
get the count of working object

Specified by:
getWorking in interface ObjectPool
Returns:

getRest

public int getRest()
get the count of rest object

Specified by:
getRest in interface ObjectPool
Returns: