| Modifier and Type | Field and Description |
|---|---|
| private final ObjectPool | |
| private final ProxySource |
| Access | Constructor and Description |
|---|---|
| public | ProxiedObjectPool(final ObjectPool<T>
The object pool to wrap pool, final ProxySource<T> The source of the proxy objects proxySource)Constructs a new proxied object pool. |
| Modifier and Type | Method and Description |
|---|---|
| public void | addObject()
Implements org. factory or other
implementation dependent mechanism, passivate it, and then place it in
the idle object pool.
|
| public T | borrowObject()
Implements org. |
| public void | clear()
Implements org. |
| public void | close()
Implements org. |
| public int | getNumActive()
Implements org. |
| public int | getNumIdle()
Implements org. |
| public void | invalidateObject(final T
a proxy)borrowed instance to be disposed.Implements org. |
| public void | returnObject(final T
a proxy)borrowed instance to be returned.Implements org. |
| public String |
| pool | back to summary |
|---|---|
| private final ObjectPool<T> pool | |
| proxySource | back to summary |
|---|---|
| private final ProxySource<T> proxySource | |
| ProxiedObjectPool | back to summary |
|---|---|
| public ProxiedObjectPool(final ObjectPool<T> pool, final ProxySource<T> proxySource) Constructs a new proxied object pool.
| |
| addObject | back to summary |
|---|---|
| public void addObject() throws Exception Implements org. Doc from org. Creates an object using the
| |
| borrowObject | back to summary |
|---|---|
| public T borrowObject() throws Exception Implements org. Doc from org. Borrows an instance from this pool.
Instances returned from this method will have been either newly created
with
By contract, clients must return the borrowed instance
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 any objects sitting idle in the pool, releasing any associated
resources (optional operation). Idle objects cleared must be
| |
| 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.
| |
| getNumActive | back to summary |
|---|---|
| public int getNumActive() Implements org. Doc from org. Gets the number of instances currently borrowed from this pool. Returns a negative value if this information is not available.
| |
| getNumIdle | back to summary |
|---|---|
| public int getNumIdle() Implements org. Doc from org. Gets the number of instances currently idle in this pool. This may be
considered an approximation of the number of objects that can be
| |
| invalidateObject | back to summary |
|---|---|
| public void invalidateObject(final T 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 T proxy) throws Exception Implements org. Doc from org. Returns 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. | |