org.apache.camel.component.sjms.jms
Class ObjectPool<T>

java.lang.Object
  extended by org.apache.camel.component.sjms.jms.ObjectPool<T>
Direct Known Subclasses:
ConnectionFactoryResource, InOutProducer.MessageConsumerPool, SessionPool, SjmsConsumer.MessageConsumerPool, SjmsProducer.MessageProducerPool

public abstract class ObjectPool<T>
extends Object

TODO Add Class documentation for ObjectPool


Field Summary
protected  org.slf4j.Logger logger
           
 
Constructor Summary
ObjectPool()
           
ObjectPool(int poolSize)
           
 
Method Summary
 T borrowObject()
           
 T borrowObject(long timeout)
           
protected abstract  T createObject()
          Implement to create new objects of type T when the pool is initialized empty.
protected abstract  void destroyObject(T t)
          Clean up pool objects
 void drainPool()
           
 void fillPool()
           
protected  ReadWriteLock getLock()
          Gets the ReadWriteLock value of lock for this instance of ObjectPool.
 int getMaxSize()
          Gets the int value of maxSize for this instance of ObjectPool.
 void returnObject(T object)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final org.slf4j.Logger logger
Constructor Detail

ObjectPool

public ObjectPool()

ObjectPool

public ObjectPool(int poolSize)
Method Detail

fillPool

public void fillPool()

drainPool

public void drainPool()
               throws Exception
Throws:
Exception

createObject

protected abstract T createObject()
                           throws Exception
Implement to create new objects of type T when the pool is initialized empty.

Returns:
Throws:
Exception

destroyObject

protected abstract void destroyObject(T t)
                               throws Exception
Clean up pool objects

Throws:
Exception

borrowObject

public T borrowObject()
               throws Exception
Returns:
Throws:
Exception

borrowObject

public T borrowObject(long timeout)
               throws Exception
Returns:
Throws:
Exception

returnObject

public void returnObject(T object)
                  throws Exception
Parameters:
object -
Throws:
Exception

getLock

protected ReadWriteLock getLock()
Gets the ReadWriteLock value of lock for this instance of ObjectPool.

Returns:
the lock

getMaxSize

public int getMaxSize()
Gets the int value of maxSize for this instance of ObjectPool.

Returns:
the maxSize


Apache Camel