|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.aop.target.AbstractPrototypeTargetSource org.springframework.aop.target.AbstractPoolingTargetSource org.springframework.aop.target.CommonsPoolTargetSource
Jakarta Commons pooling implementation extending AbstractPoolingInvokerInterceptor
Field Summary |
Fields inherited from class org.springframework.aop.target.AbstractPrototypeTargetSource |
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()
|
int |
getFree()
|
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.AbstractPrototypeTargetSource |
afterPropertiesSet, getTargetBeanName, getTargetClass, isStatic, newPrototypeInstance, setTargetBeanName |
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 AbstractPoolingTargetSource
beanFactory
- owning BeanFactory, in case we need collaborators from it
(normally our own properties are sufficient)BeanFactoryAware.setBeanFactory(org.springframework.beans.factory.BeanFactory)
protected org.apache.commons.pool.ObjectPool createObjectPool()
public java.lang.Object getTarget() throws java.lang.Exception
AbstractPoolingTargetSource
getTarget
in interface TargetSource
getTarget
in class AbstractPoolingTargetSource
java.lang.Exception
- we may need to deal with checked exceptions from pool
APIs, so we're forgiving with our exception signature,
although we don't like APIs that throw Exceptionpublic void releaseTarget(java.lang.Object target) throws java.lang.Exception
AbstractPoolingTargetSource
releaseTarget
in interface TargetSource
releaseTarget
in class AbstractPoolingTargetSource
target
- object that must have been acquired from the pool
via a call to acquireTarget()
java.lang.Exception
- to allow pooling APIs to throw exceptionpublic int getActive()
getActive
in interface PoolingConfig
public int getFree()
getFree
in interface PoolingConfig
public void destroy() throws java.lang.Exception
DisposableBean
destroy
in interface DisposableBean
java.lang.Exception
- in case of shutdown errors.
Exceptions will get logged but not rethrown to allow
other beans to release their resources too.DisposableBean.destroy()
public java.lang.Object makeObject()
makeObject
in interface org.apache.commons.pool.PoolableObjectFactory
PoolableObjectFactory.makeObject()
public void destroyObject(java.lang.Object o) throws java.lang.Exception
destroyObject
in interface org.apache.commons.pool.PoolableObjectFactory
java.lang.Exception
PoolableObjectFactory.destroyObject(java.lang.Object)
public boolean validateObject(java.lang.Object o)
validateObject
in interface org.apache.commons.pool.PoolableObjectFactory
PoolableObjectFactory.validateObject(java.lang.Object)
public void activateObject(java.lang.Object o) throws java.lang.Exception
activateObject
in interface org.apache.commons.pool.PoolableObjectFactory
java.lang.Exception
PoolableObjectFactory.activateObject(java.lang.Object)
public void passivateObject(java.lang.Object o) throws java.lang.Exception
passivateObject
in interface org.apache.commons.pool.PoolableObjectFactory
java.lang.Exception
PoolableObjectFactory.passivateObject(java.lang.Object)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |