org.huihoo.jfox.pool
Interface ObjectPool

All Known Subinterfaces:
SimpleObjectPoolInterface
All Known Implementing Classes:
ObjectPoolSupport, SimpleObjectPool, StatelessSessionBeanObjectPool

public interface ObjectPool

the method a object pool needed


Method Summary
 void clear()
          Clears any objects sitting idle in the pool, releasing any associated resources
 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
 boolean removeObject(PoolableObject obj)
          remove a poolable object from the pool
 boolean restoreObject(PoolableObject obj)
          restore the retrived object to object pool
 PoolableObject retrieveObject()
          retrieve Object from object pool
 

Method Detail

retrieveObject

public PoolableObject retrieveObject()
                              throws java.lang.Exception
retrieve Object from object pool

Returns:
Throws:
java.lang.Exception

restoreObject

public boolean restoreObject(PoolableObject obj)
restore the retrived object to object pool

Returns:
true if success, false if failed

removeObject

public boolean removeObject(PoolableObject obj)
remove a poolable object from the pool

Parameters:
obj -
Returns:

clear

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


getObjectFactory

public ObjectFactory getObjectFactory()
get the factory use to create new instances


getObjectClass

public java.lang.String getObjectClass()
get the pooled object's class type, it return by object pool's factory

Returns:

getWorking

public int getWorking()
get the count of working object

Returns:

getRest

public int getRest()
get the count of rest object

Returns: