Class ObjectPool<T>
java.lang.Object
org.identityconnectors.framework.impl.api.local.ObjectPool<T>
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionObjectPool
(ObjectPoolHandler<T> handler, ObjectPoolConfiguration config) Create a new ObjectPool -
Method Summary
Modifier and TypeMethodDescriptionBorrow an object from the pool.void
Disposes all objects in the pool.Gets a snapshot of the pool's stats at a point in time.boolean
boolean
Get the state of the pool.void
setPoolName
(String poolName) void
shutdown()
Closes any idle objects in the pool.toString()
-
Constructor Details
-
ObjectPool
Create a new ObjectPool- Parameters:
handler
- Handler for objectsconfig
- Configuration for the pool
-
-
Method Details
-
isShutdown
public boolean isShutdown()Get the state of the pool.- Returns:
- true if the
shutdown()
method was called before.
-
isDisposing
public boolean isDisposing() -
getPoolName
-
setPoolName
-
borrowObject
Borrow an object from the pool.- Returns:
- An object
-
disposeAllObjects
public void disposeAllObjects()Disposes all objects in the pool. Existing active objects will remain alive and be allowed to shutdown gracefully. Unlike shutdown, the pool will be able to work on and create new objects. -
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
Gets a snapshot of the pool's stats at a point in time.- Returns:
- The statistics
-
toString
-