org.identityconnectors.framework.impl.api.local
Class ObjectPool<T>

java.lang.Object
  extended by org.identityconnectors.framework.impl.api.local.ObjectPool<T>

public class ObjectPool<T>
extends Object


Nested Class Summary
static class ObjectPool.Statistics
          Statistics bean
 
Constructor Summary
ObjectPool(ObjectPoolHandler<T> handler, ObjectPoolConfiguration config)
          Create a new ObjectPool
 
Method Summary
 T borrowObject()
          Borrow an object from the pool.
 ObjectPool.Statistics getStatistics()
          Gets a snapshot of the pool's stats at a point in time.
 void returnObject(T object)
          Return an object to the pool
 void shutdown()
          Closes any idle objects in the pool.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectPool

public ObjectPool(ObjectPoolHandler<T> handler,
                  ObjectPoolConfiguration config)
Create a new ObjectPool

Parameters:
handler - Handler for objects
config - Configuration for the pool
Method Detail

returnObject

public void returnObject(T object)
Return an object to the pool

Parameters:
object -

borrowObject

public T borrowObject()
Borrow an object from the pool.

Returns:
An object

shutdown

public void shutdown()
Closes any idle objects in the pool. Existing active objects will remain alive and be allowed to shutdown gracefully, but no more objects will be allocated.


getStatistics

public ObjectPool.Statistics getStatistics()
Gets a snapshot of the pool's stats at a point in time.

Returns:
The statistics


Copyright © 2011. All Rights Reserved.