|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.apache.cocoon.core.container.spring.avalon.PoolableFactoryBean
This factory bean adds simple pooling support to Spring.
| Field Summary | |
protected Class |
beanClass
The class. |
protected BeanFactory |
beanFactory
The corresponding bean factory. |
static String |
DEFAULT_MAX_POOL_SIZE
The default max size of the pool. |
protected Class[] |
interfaces
All the interfaces for the proxy. |
protected Log |
log
Logger (we use the same logging mechanism as Spring!) |
protected String |
name
The pooled component. |
protected Method |
poolInMethod
|
protected String |
poolInMethodName
Pool-in-method-name. |
protected Method |
poolOutMethod
|
protected String |
poolOutMethodName
Pool-out-method-name. |
protected Object |
semaphore
Object used to synchronize access to the get and put methods |
| Constructor Summary | |
PoolableFactoryBean(String name,
String className)
Create a PoolableComponentHandler which manages a pool of Components created by the specified factory object. |
|
PoolableFactoryBean(String name,
String className,
String poolMaxString,
org.apache.cocoon.configuration.Settings settings)
Create a PoolableComponentHandler which manages a pool of Components created by the specified factory object. |
|
| Method Summary | |
void |
dispose()
Dispose of associated Pools and Factories. |
protected void |
enteringPool(Object component)
Handle service specific methods for putting it into the pool |
protected void |
exitingPool(Object component)
Handle service specific methods for getting it out of the pool |
Object |
getFromPool()
Gets a Poolable from the pool. |
Object |
getObject()
|
Class |
getObjectType()
|
void |
initialize()
|
boolean |
isSingleton()
|
protected void |
permanentlyRemovePoolable(Object poolable)
Permanently removes a poolable from the pool's active list and destroys it so that it will not ever be reused. |
void |
putIntoPool(Object poolable)
Returns a poolable to the pool |
void |
setBeanFactory(BeanFactory beanFactory)
|
void |
setPoolInMethodName(String poolInMethodName)
|
void |
setPoolOutMethodName(String poolOutMethodName)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected final Log log
public static final String DEFAULT_MAX_POOL_SIZE
protected final Class[] interfaces
protected final String name
protected final Class beanClass
protected BeanFactory beanFactory
protected final Object semaphore
protected String poolInMethodName
protected String poolOutMethodName
protected Method poolInMethod
protected Method poolOutMethod
| Constructor Detail |
public PoolableFactoryBean(String name,
String className)
throws Exception
name - The name of the bean which should be pooled.
public PoolableFactoryBean(String name,
String className,
String poolMaxString,
org.apache.cocoon.configuration.Settings settings)
throws Exception
name - The name of the bean which should be pooled.| Method Detail |
public void setPoolInMethodName(String poolInMethodName)
public void setPoolOutMethodName(String poolOutMethodName)
public void initialize()
throws Exception
Exceptionpublic void dispose()
protected void permanentlyRemovePoolable(Object poolable)
This method is only called by threads that have m_semaphore locked.
public Object getFromPool()
throws Exception
Exception - An exception may be thrown as described above or if there is an exception
thrown by the ObjectFactory's newInstance() method.public void putIntoPool(Object poolable)
poolable - Poolable to return to the pool.
protected void exitingPool(Object component)
throws Exception
Exceptionprotected void enteringPool(Object component)
public void setBeanFactory(BeanFactory beanFactory)
throws BeansException
setBeanFactory in interface BeanFactoryAwareBeansExceptionBeanFactoryAware.setBeanFactory(org.springframework.beans.factory.BeanFactory)
public Object getObject()
throws Exception
getObject in interface FactoryBeanExceptionFactoryBean.getObject()public Class getObjectType()
getObjectType in interface FactoryBeanFactoryBean.getObjectType()public boolean isSingleton()
isSingleton in interface FactoryBeanFactoryBean.isSingleton()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||