Package org.apache.camel.component.netty
Class SharedSingletonObjectPool<T>
- java.lang.Object
-
- org.apache.camel.component.netty.SharedSingletonObjectPool<T>
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,org.apache.commons.pool2.ObjectPool<T>
public class SharedSingletonObjectPool<T> extends Object implements org.apache.commons.pool2.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.pool2.PooledObjectFactory<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)
-
-
-
Constructor Detail
-
SharedSingletonObjectPool
public SharedSingletonObjectPool(org.apache.commons.pool2.PooledObjectFactory<T> factory)
-
-
Method Detail
-
addObject
public void addObject() throws Exception, IllegalStateException, UnsupportedOperationException
- Specified by:
addObject
in interfaceorg.apache.commons.pool2.ObjectPool<T>
- Throws:
Exception
IllegalStateException
UnsupportedOperationException
-
borrowObject
public T borrowObject() throws Exception, NoSuchElementException, IllegalStateException
- Specified by:
borrowObject
in interfaceorg.apache.commons.pool2.ObjectPool<T>
- Throws:
Exception
NoSuchElementException
IllegalStateException
-
clear
public void clear() throws Exception, UnsupportedOperationException
- Specified by:
clear
in interfaceorg.apache.commons.pool2.ObjectPool<T>
- Throws:
Exception
UnsupportedOperationException
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceorg.apache.commons.pool2.ObjectPool<T>
-
getNumActive
public int getNumActive()
- Specified by:
getNumActive
in interfaceorg.apache.commons.pool2.ObjectPool<T>
-
getNumIdle
public int getNumIdle()
- Specified by:
getNumIdle
in interfaceorg.apache.commons.pool2.ObjectPool<T>
-
-