Class AbstractResourcePool<W extends AbstractWrapperResource<W,R>, R extends GroupCloseable>
java.lang.Object
ch.nolix.base.resourcecontrol.resourcepool.AbstractResourcePool<W,R>
- Type Parameters:
W- is the type of theAbstractWrapperResources of aAbstractResourcePool.R- is the type of the resource of theAbstractWrapperResources of aAbstractResourcePool.
- All Implemented Interfaces:
Closeable, CloseStateRequestable, GroupCloseable, IResourcePool<W>, AutoCloseable
- Direct Known Subclasses:
SqlConnectionPool
public abstract class AbstractResourcePool<W extends AbstractWrapperResource<W,R>, R extends GroupCloseable>
extends Object
implements IResourcePool<W>
- Author:
- Silvan Wyss
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal Wfinal ICloseControllerfinal voidLets the currentGroupCloseablenote a close.Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface CloseStateRequestable
isOpenMethods inherited from interface GroupCloseable
close, createCloseDependencyTo, isClosed
-
Constructor Details
-
AbstractResourcePool
public AbstractResourcePool()
-
-
Method Details
-
borrowResource
- Specified by:
borrowResourcein interfaceIResourcePool<W extends AbstractWrapperResource<W,R>> - Returns:
- resource from the current
IResourcePoolwhich will be borrowed. When The resource is closed its internal resource will be given back to the currentIResourcePooland will be available again.
-
getStoredCloseController
- Specified by:
getStoredCloseControllerin interfaceGroupCloseable- Returns:
- the
ICloseControllerof the currentGroupCloseable.
-
noteClose
public final void noteClose()Lets the currentGroupCloseablenote a close.- Specified by:
noteClosein interfaceGroupCloseable
-