Package com.atlassian.bitbucket.util
Interface Drainable
- All Known Subinterfaces:
ForcedDrainable
public interface Drainable
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.-
Method Summary
-
Method Details
-
drain
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 millisecondsunit- the unit the provided timeout is in- Returns:
trueif the pool was drained; otherwise,falseif 1 or more resources could not be accounted for within the specified timeout
-