Interface ManagedObjectPool
- All Known Implementing Classes:
AbstractHttpServerImplementationTestCase.CancelConnectionManagedObjectSource
public interface ManagedObjectPool
Pool of
ManagedObject instances.- Author:
- Daniel Sagenschneider
-
Method Summary
Modifier and TypeMethodDescriptionvoidempty()Invoked on close of theOfficeFloorto allow handling pooledManagedObjectinstances.default ManagedObjectgetSourcedManagedObject(ManagedObject pooledManagedObject) Should theManagedObjectPoolcreate a wrapperManagedObjectfor pooling, this method is required to be implemented to extract theManagedObjectsourced from theManagedObjectSource.voidlostManagedObject(ManagedObject managedObject, Throwable cause) Flags that theManagedObjectis lost.voidreturnManagedObject(ManagedObject managedObject) Returns an instance to the pool.voidSources theManagedObjectfrom thisManagedObjectPool.
-
Method Details
-
getSourcedManagedObject
Should theManagedObjectPoolcreate a wrapperManagedObjectfor pooling, this method is required to be implemented to extract theManagedObjectsourced from theManagedObjectSource.- Parameters:
pooledManagedObject-ManagedObjectsource from thisManagedObjectPool.- Returns:
ManagedObjectsourced from the underlyingManagedObjectSource.
-
sourceManagedObject
Sources theManagedObjectfrom thisManagedObjectPool.- Parameters:
user-ManagedObjectUserrequiring theManagedObject.
-
returnManagedObject
Returns an instance to the pool.- Parameters:
managedObject-ManagedObject.
-
lostManagedObject
Flags that theManagedObjectis lost.- Parameters:
managedObject-ManagedObjectto no longer be used.cause- Cause for theManagedObjectto be lost.
-
empty
void empty()Invoked on close of theOfficeFloorto allow handling pooledManagedObjectinstances.
-