com.jdon.controller.pool
Class CommonsPoolAdapter
java.lang.Object
com.jdon.controller.pool.CommonsPoolAdapter
- All Implemented Interfaces:
- Pool
public class CommonsPoolAdapter
- extends java.lang.Object
- implements Pool
ObjectPool pool = new StackObjectPool(new MyPoolableObjectFactory());
CommonsPoolAdapter cp = new CommonsPoolAdapter(pool);
MyObject mo = (MyObject)cp.borrowObject();
....
cp.returnObject(mo);
@author banq
|
Constructor Summary |
CommonsPoolAdapter(org.apache.commons.pool.impl.GenericObjectPool pool)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CommonsPoolAdapter
public CommonsPoolAdapter(org.apache.commons.pool.impl.GenericObjectPool pool)
setMaxPoolSize
public void setMaxPoolSize(int maxPoolSize)
- Specified by:
setMaxPoolSize in interface Pool
getMaxPoolSize
public int getMaxPoolSize()
- Specified by:
getMaxPoolSize in interface Pool
acquirePoolable
public java.lang.Object acquirePoolable()
throws java.lang.Exception
- Specified by:
acquirePoolable in interface Pool
- Throws:
java.lang.Exception
releasePoolable
public void releasePoolable(java.lang.Object object)
throws java.lang.Exception
- Specified by:
releasePoolable in interface Pool
- Throws:
java.lang.Exception
getNumActive
public int getNumActive()
- Specified by:
getNumActive in interface Pool
getNumIdle
public int getNumIdle()
- Specified by:
getNumIdle in interface Pool