Package org.apache.camel.component.netty
Class SharedSingletonObjectPool<T>
- java.lang.Object
-
- org.apache.camel.component.netty.SharedSingletonObjectPool<T>
-
- All Implemented Interfaces:
org.apache.commons.pool.ObjectPool<T>
public class SharedSingletonObjectPool<T> extends Object implements org.apache.commons.pool.ObjectPool<T>
AnObjectPool
that uses a single shared instance. This implementation will always return 1 ingetNumActive()
and return 0 ingetNumIdle()
.
-
-
Constructor Summary
Constructors Constructor Description SharedSingletonObjectPool(org.apache.commons.pool.PoolableObjectFactory<T> factory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addObject()
T
borrowObject()
void
clear()
void
close()
int
getNumActive()
int
getNumIdle()
void
invalidateObject(T obj)
void
returnObject(T obj)
void
setFactory(org.apache.commons.pool.PoolableObjectFactory<T> factory)
-
-
-
Constructor Detail
-
SharedSingletonObjectPool
public SharedSingletonObjectPool(org.apache.commons.pool.PoolableObjectFactory<T> factory)
-
-
Method Detail
-
borrowObject
public T borrowObject() throws Exception, NoSuchElementException, IllegalStateException
- Specified by:
borrowObject
in interfaceorg.apache.commons.pool.ObjectPool<T>
- Throws:
Exception
NoSuchElementException
IllegalStateException
-
addObject
public void addObject() throws Exception, IllegalStateException, UnsupportedOperationException
- Specified by:
addObject
in interfaceorg.apache.commons.pool.ObjectPool<T>
- Throws:
Exception
IllegalStateException
UnsupportedOperationException
-
getNumIdle
public int getNumIdle() throws UnsupportedOperationException
- Specified by:
getNumIdle
in interfaceorg.apache.commons.pool.ObjectPool<T>
- Throws:
UnsupportedOperationException
-
getNumActive
public int getNumActive() throws UnsupportedOperationException
- Specified by:
getNumActive
in interfaceorg.apache.commons.pool.ObjectPool<T>
- Throws:
UnsupportedOperationException
-
clear
public void clear() throws Exception, UnsupportedOperationException
- Specified by:
clear
in interfaceorg.apache.commons.pool.ObjectPool<T>
- Throws:
Exception
UnsupportedOperationException
-
close
public void close() throws Exception
-
setFactory
public void setFactory(org.apache.commons.pool.PoolableObjectFactory<T> factory) throws IllegalStateException, UnsupportedOperationException
- Specified by:
setFactory
in interfaceorg.apache.commons.pool.ObjectPool<T>
- Throws:
IllegalStateException
UnsupportedOperationException
-
-