| 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
the key a new instance should be added to key)Implements org. factory or
other implementation dependent mechanism, passivate it, and then place it
in the idle object pool.
|
| public V | borrowObject(final K
the key used to obtain the object key)Implements org. key.
|
| public void | clear()
Implements org. |
| public void | clear(final K
the key to clear key)Implements org. key (optional operation).
|
| public void | close()
Implements org. |
| public List | Returns: a copy of the pool key list.Overrides default org. |
| public int | getNumActive()
Implements org. |
| public int | getNumActive(final K
the key to query key)Implements org. key.
|
| public int | getNumIdle()
Implements org. |
| public int | getNumIdle(final K
the key to query key)Implements org. key currently idle in this pool.
|
| public void | invalidateObject(final K
the key used to obtain the object key, final V a proxy)borrowed instance to be returned.Implements org. |
| public void | returnObject(final K
the key used to obtain the object key, final V a proxy)borrowed instance to be returned.Implements org. |
| 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. | |