|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.aop.target.AbstractBeanFactoryBasedTargetSource org.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.AbstractBeanFactoryBasedTargetSource |
logger |
Constructor Summary | |
CommonsPoolTargetSource()
|
Method Summary | |
void |
activateObject(Object o)
|
protected 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(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. |
Object |
getTarget()
Acquire an object from the pool. |
Object |
makeObject()
|
void |
passivateObject(Object o)
|
void |
releaseTarget(Object target)
Return the given object to the pool. |
boolean |
validateObject(Object o)
|
Methods inherited from class org.springframework.aop.target.AbstractPoolingTargetSource |
getMaxSize, getPoolingConfigMixin, setBeanFactory, setMaxSize |
Methods inherited from class org.springframework.aop.target.AbstractPrototypeBasedTargetSource |
newPrototypeInstance |
Methods inherited from class org.springframework.aop.target.AbstractBeanFactoryBasedTargetSource |
getBeanFactory, getTargetBeanName, getTargetClass, isStatic, 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 AbstractPoolingTargetSource
beanFactory
- owning BeanFactory, in case we need collaborators from it
(normally our own properties are sufficient)protected ObjectPool createObjectPool()
public Object getTarget() throws Exception
AbstractPoolingTargetSource
getTarget
in interface TargetSource
getTarget
in class AbstractPoolingTargetSource
Exception
- we may need to deal with checked exceptions from pool
APIs, so we're forgiving with our exception signaturepublic void releaseTarget(Object target) throws Exception
AbstractPoolingTargetSource
releaseTarget
in interface TargetSource
releaseTarget
in class AbstractPoolingTargetSource
target
- object that must have been acquired from the pool
via a call to getTarget()
Exception
- to allow pooling APIs to throw exceptionAbstractPoolingTargetSource.getTarget()
public int getActiveCount() throws UnsupportedOperationException
PoolingConfig
getActiveCount
in interface PoolingConfig
UnsupportedOperationException
- if not supported by the poolpublic int getIdleCount() throws UnsupportedOperationException
PoolingConfig
getIdleCount
in interface PoolingConfig
UnsupportedOperationException
- if not supported by the poolpublic int getActive()
getActive
in interface PoolingConfig
getActiveCount()
public int getFree()
getFree
in interface PoolingConfig
getIdleCount()
public void destroy() throws Exception
DisposableBean
destroy
in interface DisposableBean
Exception
- in case of shutdown errors.
Exceptions will get logged but not rethrown to allow
other beans to release their resources too.public Object makeObject() throws BeansException
makeObject
in interface PoolableObjectFactory
BeansException
public void destroyObject(Object o) throws Exception
destroyObject
in interface PoolableObjectFactory
Exception
public boolean validateObject(Object o)
validateObject
in interface PoolableObjectFactory
public void activateObject(Object o) throws Exception
activateObject
in interface PoolableObjectFactory
Exception
public void passivateObject(Object o) throws Exception
passivateObject
in interface PoolableObjectFactory
Exception
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |