public class CommonsPoolObjectPool extends Object implements ObjectPool
CommonsPoolProxyPool is an implementation of ObjectPool that internally uses the commons-pool
GenericObjectPool and uses a ObjectFactory for creating new pooled instances.| Modifier and Type | Field and Description |
|---|---|
protected static org.slf4j.Logger |
logger
logger used by this class
|
protected MuleContext |
muleContext |
protected ObjectFactory |
objectFactory
The ObjectFactory used to create new pool instances
|
protected org.apache.commons.pool.impl.GenericObjectPool |
pool
The pool
|
protected org.mule.runtime.api.config.PoolingProfile |
poolingProfile
The pooling profile used to configure and initialise pool
|
| Constructor and Description |
|---|
CommonsPoolObjectPool(ObjectFactory objectFactory,
org.mule.runtime.api.config.PoolingProfile poolingProfile,
MuleContext muleContext)
Creates a new pool and an Object factory with the ServiceDescriptor
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
applyInitialisationPolicy() |
Object |
borrowObject() |
void |
clear() |
void |
close() |
void |
dispose() |
int |
getMaxActive() |
int |
getNumActive() |
ObjectFactory |
getObjectFactory() |
protected org.apache.commons.pool.PoolableObjectFactory |
getPooledObjectFactory()
Template method to be overridden by implementations that do more than just invoke objectFactory
|
void |
initialise() |
void |
returnObject(Object object) |
void |
setObjectFactory(ObjectFactory objectFactory) |
protected static final org.slf4j.Logger logger
protected org.apache.commons.pool.impl.GenericObjectPool pool
protected ObjectFactory objectFactory
protected org.mule.runtime.api.config.PoolingProfile poolingProfile
protected MuleContext muleContext
public CommonsPoolObjectPool(ObjectFactory objectFactory, org.mule.runtime.api.config.PoolingProfile poolingProfile, MuleContext muleContext)
public void initialise()
throws org.mule.runtime.api.lifecycle.InitialisationException
initialise in interface org.mule.runtime.api.lifecycle.Initialisableorg.mule.runtime.api.lifecycle.InitialisationExceptionprotected org.apache.commons.pool.PoolableObjectFactory getPooledObjectFactory()
protected void applyInitialisationPolicy()
throws Exception
Exceptionpublic Object borrowObject() throws Exception
borrowObject in interface ObjectPoolExceptionpublic void returnObject(Object object)
returnObject in interface ObjectPoolpublic int getNumActive()
getNumActive in interface ObjectPoolpublic int getMaxActive()
getMaxActive in interface ObjectPoolpublic void dispose()
dispose in interface org.mule.runtime.api.lifecycle.Disposablepublic void clear()
clear in interface ObjectPoolpublic void close()
close in interface ObjectPoolpublic void setObjectFactory(ObjectFactory objectFactory)
setObjectFactory in interface ObjectPoolpublic ObjectFactory getObjectFactory()
getObjectFactory in interface ObjectPoolCopyright © 2003–2017 MuleSoft, Inc.. All rights reserved.