java.lang.Object | |||
↳ | org.springframework.aop.target.AbstractBeanFactoryBasedTargetSource | ||
↳ | org.springframework.aop.target.AbstractPrototypeBasedTargetSource | ||
↳ | org.springframework.aop.target.AbstractPoolingTargetSource |
Known Direct Subclasses |
Abstract base class for pooling TargetSource
implementations which maintain a pool of target instances, acquiring and
releasing a target object from the pool for each method invocation.
This abstract base class is independent of concrete pooling technology;
see the subclass CommonsPoolTargetSource
for a concrete example.
Subclasses must implement the getTarget()
and
releaseTarget(Object)
methods based on their chosen object pool.
The newPrototypeInstance()
method inherited from
AbstractPrototypeBasedTargetSource
can be used to create objects
in order to put them into the pool.
Subclasses must also implement some of the monitoring methods from the
PoolingConfig
interface. The getPoolingConfigMixin()
method
makes these stats available on proxied objects through an IntroductionAdvisor.
This class implements the DisposableBean
interface in order to force subclasses to implement a destroy()
method, closing down their object pool.
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.springframework.aop.target.AbstractBeanFactoryBasedTargetSource
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Return the maximum size of the pool.
| |||||||||||
Return an IntroductionAdvisor that providing a mixin
exposing statistics about the pool maintained by this object.
| |||||||||||
Acquire an object from the pool.
| |||||||||||
Return the given object to the pool.
| |||||||||||
Set the owning BeanFactory.
| |||||||||||
Set the maximum size of the pool.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Create the pool.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.springframework.aop.target.AbstractPrototypeBasedTargetSource
| |||||||||||
From class
org.springframework.aop.target.AbstractBeanFactoryBasedTargetSource
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
org.springframework.aop.TargetClassAware
| |||||||||||
From interface
org.springframework.aop.TargetSource
| |||||||||||
From interface
org.springframework.aop.target.PoolingConfig
| |||||||||||
From interface
org.springframework.beans.factory.BeanFactoryAware
| |||||||||||
From interface
org.springframework.beans.factory.DisposableBean
|
Return the maximum size of the pool.
Return an IntroductionAdvisor that providing a mixin exposing statistics about the pool maintained by this object.
Acquire an object from the pool.
Exception | we may need to deal with checked exceptions from pool APIs, so we're forgiving with our exception signature |
---|
Return the given object to the pool.
target | object that must have been acquired from the pool
via a call to getTarget() |
---|
Exception | to allow pooling APIs to throw exception |
---|
Set the owning BeanFactory. We need to save a reference so that we can
use the getBean
method on every invocation.
beanFactory | owning BeanFactory (never null ).
The bean can immediately call methods on the factory. |
---|
BeansException |
---|
Set the maximum size of the pool. Default is -1, indicating no size limit.
Create the pool.
Exception | to avoid placing constraints on pooling APIs |
---|