| com.atlassian.bitbucket.util.Drainable |
Known Indirect Subclasses
| ForcedDrainable |
Indicates connection pools and similar data structures which have a means of waiting for resources to close/clean up
and additionally support a more aggressive form of draining which attempts to forcibly release the underlying
resources. |
|
Class Overview
Indicates connection pools and similar data structures have a means of waiting for resources to close/clean up.
The drain method may be used to block while all
resources are closed or cleaned up in some implementation-specific way.
Summary
| Public Methods |
|
boolean
|
drain(long timeout, TimeUnit unit)
Waits for all resources to become free.
|
Public Methods
public
boolean
drain
(long timeout, TimeUnit unit)
Waits for all resources to become free. For pooling resources, draining ensures
all pooled resources have been returned to the pool.
Parameters
| timeout
| the timeout which, using the specified unit, will be converted to milliseconds |
| unit
| the unit the provided timeout is in |
Returns
true if the pool was drained; otherwise, false if 1 or more resources could not
be accounted for within the specified timeout