|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.springframework.aop.target.AbstractPrototypeBasedTargetSource
org.springframework.aop.target.AbstractPoolingTargetSource
org.springframework.aop.target.CommonsPoolTargetSource
Jakarta Commons pooling implementation extending AbstractPoolingTargetSource.
| Field Summary |
| Fields inherited from class org.springframework.aop.target.AbstractPrototypeBasedTargetSource |
logger |
| Constructor Summary | |
CommonsPoolTargetSource()
|
|
| Method Summary | |
void |
activateObject(java.lang.Object o)
|
protected org.apache.commons.pool.ObjectPool |
createObjectPool()
Subclasses can override this if they want to return a different Commons pool to GenericObject pool. |
protected void |
createPool(BeanFactory beanFactory)
Create the pool. |
void |
destroy()
Invoked by a BeanFactory on destruction of a singleton. |
void |
destroyObject(java.lang.Object o)
|
int |
getActive()
Deprecated. in favor of getActiveCount |
int |
getActiveCount()
Return the number of active objects in the pool. |
int |
getFree()
Deprecated. in favor of getIdleCount |
int |
getIdleCount()
Return the number of idle objects in the pool. |
java.lang.Object |
getTarget()
Acquire an object from the pool. |
java.lang.Object |
makeObject()
|
void |
passivateObject(java.lang.Object o)
|
void |
releaseTarget(java.lang.Object target)
Return the given object to the pool. |
boolean |
validateObject(java.lang.Object o)
|
| Methods inherited from class org.springframework.aop.target.AbstractPoolingTargetSource |
getMaxSize, getPoolingConfigMixin, setBeanFactory, setMaxSize |
| Methods inherited from class org.springframework.aop.target.AbstractPrototypeBasedTargetSource |
afterPropertiesSet, getTargetBeanName, getTargetClass, isStatic, newPrototypeInstance, setTargetBeanName, writeReplace |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public CommonsPoolTargetSource()
| Method Detail |
protected final void createPool(BeanFactory beanFactory)
AbstractPoolingTargetSource
createPool in class AbstractPoolingTargetSourcebeanFactory - owning BeanFactory, in case we need collaborators from it
(normally our own properties are sufficient)protected org.apache.commons.pool.ObjectPool createObjectPool()
public java.lang.Object getTarget()
throws java.lang.Exception
AbstractPoolingTargetSource
getTarget in interface TargetSourcegetTarget in class AbstractPoolingTargetSourcejava.lang.Exception - we may need to deal with checked exceptions from pool
APIs, so we're forgiving with our exception signature
public void releaseTarget(java.lang.Object target)
throws java.lang.Exception
AbstractPoolingTargetSource
releaseTarget in interface TargetSourcereleaseTarget in class AbstractPoolingTargetSourcetarget - object that must have been acquired from the pool
via a call to getTarget()
java.lang.Exception - to allow pooling APIs to throw exceptionAbstractPoolingTargetSource.getTarget()
public int getActiveCount()
throws java.lang.UnsupportedOperationException
PoolingConfig
getActiveCount in interface PoolingConfigjava.lang.UnsupportedOperationException - if not supported by the pool
public int getIdleCount()
throws java.lang.UnsupportedOperationException
PoolingConfig
getIdleCount in interface PoolingConfigjava.lang.UnsupportedOperationException - if not supported by the poolpublic int getActive()
getActive in interface PoolingConfiggetActiveCount()public int getFree()
getFree in interface PoolingConfiggetIdleCount()
public void destroy()
throws java.lang.Exception
DisposableBean
destroy in interface DisposableBeanjava.lang.Exception - in case of shutdown errors.
Exceptions will get logged but not rethrown to allow
other beans to release their resources too.public java.lang.Object makeObject()
makeObject in interface org.apache.commons.pool.PoolableObjectFactory
public void destroyObject(java.lang.Object o)
throws java.lang.Exception
destroyObject in interface org.apache.commons.pool.PoolableObjectFactoryjava.lang.Exceptionpublic boolean validateObject(java.lang.Object o)
validateObject in interface org.apache.commons.pool.PoolableObjectFactory
public void activateObject(java.lang.Object o)
throws java.lang.Exception
activateObject in interface org.apache.commons.pool.PoolableObjectFactoryjava.lang.Exception
public void passivateObject(java.lang.Object o)
throws java.lang.Exception
passivateObject in interface org.apache.commons.pool.PoolableObjectFactoryjava.lang.Exception
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||