| Modifier and Type | Field and Description |
|---|---|
| private final KeyedObjectPool | |
| private final ProxySource |
| Access | Constructor and Description |
|---|---|
| public | ProxiedKeyedObjectPool(final KeyedObjectPool<K, V>
The object pool to wrap pool, final ProxySource<V> The source of the proxy objects proxySource)Constructs a new proxied object pool. |
| Modifier and Type | Method and Description |
|---|---|
| public void | addObject(final K key)
Implements org. Creates an object using the |
| public V | borrowObject(final K key)
Implements org. Borrows an instance from this pool for the specified |
| public void | clear()
Implements org. Clears the pool, removing all pooled instances (optional operation). |
| public void | clear(final K key)
Implements org. Clears the specified pool, removing all pooled instances corresponding to
the given |
| public void | close()
Implements org. Closes this pool, and free any resources associated with it. |
| public List | Returns: a copy of the pool key list.Overrides default org. Gets a copy of the pool key list. |
| public int | getNumActive()
Implements org. Gets the total number of instances currently borrowed from this pool but not yet returned. |
| public int | getNumActive(final K key)
Implements org. Gets the number of instances currently borrowed from but not yet
returned to the pool corresponding to the given |
| public int | getNumIdle()
Implements org. Gets the total number of instances currently idle in this pool. |
| public int | getNumIdle(final K key)
Implements org. Gets the number of instances corresponding to the given
|
| public void | invalidateObject(final K key, final V proxy)
Implements org. Invalidates an object from the pool. |
| public void | returnObject(final K key, final V proxy)
Implements org. Return an instance to the pool. |
| public String |
| pool | back to summary |
|---|---|
| private final KeyedObjectPool<K, V> pool | |
| proxySource | back to summary |
|---|---|
| private final ProxySource<V> proxySource | |
| ProxiedKeyedObjectPool | back to summary |
|---|---|
| public ProxiedKeyedObjectPool(final KeyedObjectPool<K, V> pool, final ProxySource<V> proxySource) Constructs a new proxied object pool.
| |
| addObject | back to summary |
|---|---|
| public void addObject(final K key) throws Exception Implements org. Doc from org. Creates an object using the
| |
| borrowObject | back to summary |
|---|---|
| public V borrowObject(final K key) throws Exception Implements org. Doc from org. Borrows an instance from this pool for the specified
Instances returned from this method will have been either newly created
with
By contract, clients must return the borrowed object
using The behavior of this method when the pool has been exhausted is not strictly specified (although it may be specified by implementations).
| |
| clear | back to summary |
|---|---|
| public void clear() throws Exception Implements org. Doc from org. Clears the pool, removing all pooled instances (optional operation). | |
| clear | back to summary |
|---|---|
| public void clear(final K key) throws Exception Implements org. Doc from org. Clears the specified pool, removing all pooled instances corresponding to
the given | |
| close | back to summary |
|---|---|
| public void close() Implements org. Doc from org. Closes this pool, and free any resources associated with it.
Calling Implementations should silently fail if not all resources can be freed.
| |
| getKeys | back to summary |
|---|---|
| public List Overrides default org. Gets a copy of the pool key list. | |
| getNumActive | back to summary |
|---|---|
| public int getNumActive() Implements org. Doc from org. Gets the total number of instances currently borrowed from this pool but not yet returned. Returns a negative value if this information is not available.
| |
| getNumActive | back to summary |
|---|---|
| public int getNumActive(final K key) Implements org. Doc from org. Gets the number of instances currently borrowed from but not yet
returned to the pool corresponding to the given
| |
| getNumIdle | back to summary |
|---|---|
| public int getNumIdle() Implements org. Doc from org. Gets the total number of instances currently idle in this pool. Returns a negative value if this information is not available.
| |
| getNumIdle | back to summary |
|---|---|
| public int getNumIdle(final K key) Implements org. Doc from org. Gets the number of instances corresponding to the given
| |
| invalidateObject | back to summary |
|---|---|
| public void invalidateObject(final K key, final V proxy) throws Exception Implements org. Doc from org. Invalidates an object from the pool.
By contract, This method should be used when an object that has been borrowed is determined (due to an exception or other problem) to be invalid. | |
| returnObject | back to summary |
|---|---|
| public void returnObject(final K key, final V proxy) throws Exception Implements org. Doc from org. Return an instance to the pool. By contract, | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non-
| |