|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.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 AbstractPoolingTargetSourcebeanFactory - 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 TargetSourcegetTarget in class AbstractPoolingTargetSourceException - we may need to deal with checked exceptions from pool
APIs, so we're forgiving with our exception signature
public void releaseTarget(Object target)
throws Exception
AbstractPoolingTargetSource
releaseTarget in interface TargetSourcereleaseTarget in class AbstractPoolingTargetSourcetarget - 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 PoolingConfigUnsupportedOperationException - if not supported by the pool
public int getIdleCount()
throws UnsupportedOperationException
PoolingConfig
getIdleCount in interface PoolingConfigUnsupportedOperationException - if not supported by the poolpublic int getActive()
getActive in interface PoolingConfiggetActiveCount()public int getFree()
getFree in interface PoolingConfiggetIdleCount()
public void destroy()
throws Exception
DisposableBean
destroy in interface DisposableBeanException - 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 PoolableObjectFactoryBeansException
public void destroyObject(Object o)
throws Exception
destroyObject in interface PoolableObjectFactoryExceptionpublic boolean validateObject(Object o)
validateObject in interface PoolableObjectFactory
public void activateObject(Object o)
throws Exception
activateObject in interface PoolableObjectFactoryException
public void passivateObject(Object o)
throws Exception
passivateObject in interface PoolableObjectFactoryException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||