Interface ManagedObjectPool
-
- All Known Implementing Classes:
AbstractHttpServerImplementationTest.CancelConnectionManagedObjectSource
public interface ManagedObjectPoolPool ofManagedObjectinstances.- Author:
- Daniel Sagenschneider
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidempty()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, java.lang.Throwable cause)Flags that theManagedObjectis lost.voidreturnManagedObject(ManagedObject managedObject)Returns an instance to the pool.voidsourceManagedObject(ManagedObjectUser user)Sources theManagedObjectfrom thisManagedObjectPool.
-
-
-
Method Detail
-
getSourcedManagedObject
default ManagedObject getSourcedManagedObject(ManagedObject pooledManagedObject)
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
void sourceManagedObject(ManagedObjectUser user)
Sources theManagedObjectfrom thisManagedObjectPool.- Parameters:
user-ManagedObjectUserrequiring theManagedObject.
-
returnManagedObject
void returnManagedObject(ManagedObject managedObject)
Returns an instance to the pool.- Parameters:
managedObject-ManagedObject.
-
lostManagedObject
void lostManagedObject(ManagedObject managedObject, java.lang.Throwable cause)
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.
-
-