org.apache.camel.component.netty
Class SharedSingletonObjectPool<T>

java.lang.Object
  extended by 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>

An ObjectPool that uses a single shared instance.

This implementation will always return 1 in getNumActive() and return 0 in getNumIdle().


Constructor Summary
SharedSingletonObjectPool(org.apache.commons.pool.PoolableObjectFactory<T> factory)
           
 
Method Summary
 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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 interface org.apache.commons.pool.ObjectPool<T>
Throws:
Exception
NoSuchElementException
IllegalStateException

returnObject

public void returnObject(T obj)
                  throws Exception
Specified by:
returnObject in interface org.apache.commons.pool.ObjectPool<T>
Throws:
Exception

invalidateObject

public void invalidateObject(T obj)
                      throws Exception
Specified by:
invalidateObject in interface org.apache.commons.pool.ObjectPool<T>
Throws:
Exception

addObject

public void addObject()
               throws Exception,
                      IllegalStateException,
                      UnsupportedOperationException
Specified by:
addObject in interface org.apache.commons.pool.ObjectPool<T>
Throws:
Exception
IllegalStateException
UnsupportedOperationException

getNumIdle

public int getNumIdle()
               throws UnsupportedOperationException
Specified by:
getNumIdle in interface org.apache.commons.pool.ObjectPool<T>
Throws:
UnsupportedOperationException

getNumActive

public int getNumActive()
                 throws UnsupportedOperationException
Specified by:
getNumActive in interface org.apache.commons.pool.ObjectPool<T>
Throws:
UnsupportedOperationException

clear

public void clear()
           throws Exception,
                  UnsupportedOperationException
Specified by:
clear in interface org.apache.commons.pool.ObjectPool<T>
Throws:
Exception
UnsupportedOperationException

close

public void close()
           throws Exception
Specified by:
close in interface org.apache.commons.pool.ObjectPool<T>
Throws:
Exception

setFactory

public void setFactory(org.apache.commons.pool.PoolableObjectFactory<T> factory)
                throws IllegalStateException,
                       UnsupportedOperationException
Specified by:
setFactory in interface org.apache.commons.pool.ObjectPool<T>
Throws:
IllegalStateException
UnsupportedOperationException


Apache Camel