Interface ManagedObjectPool
-
- All Known Implementing Classes:
AbstractHttpServerImplementationTestCase.CancelConnectionManagedObjectSource
public interface ManagedObjectPool
Pool ofManagedObject
instances.- Author:
- Daniel Sagenschneider
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
empty()
Invoked on close of theOfficeFloor
to allow handling pooledManagedObject
instances.default ManagedObject
getSourcedManagedObject(ManagedObject pooledManagedObject)
Should theManagedObjectPool
create a wrapperManagedObject
for pooling, this method is required to be implemented to extract theManagedObject
sourced from theManagedObjectSource
.void
lostManagedObject(ManagedObject managedObject, java.lang.Throwable cause)
Flags that theManagedObject
is lost.void
returnManagedObject(ManagedObject managedObject)
Returns an instance to the pool.void
sourceManagedObject(ManagedObjectUser user)
Sources theManagedObject
from thisManagedObjectPool
.
-
-
-
Method Detail
-
getSourcedManagedObject
default ManagedObject getSourcedManagedObject(ManagedObject pooledManagedObject)
Should theManagedObjectPool
create a wrapperManagedObject
for pooling, this method is required to be implemented to extract theManagedObject
sourced from theManagedObjectSource
.- Parameters:
pooledManagedObject
-ManagedObject
source from thisManagedObjectPool
.- Returns:
ManagedObject
sourced from the underlyingManagedObjectSource
.
-
sourceManagedObject
void sourceManagedObject(ManagedObjectUser user)
Sources theManagedObject
from thisManagedObjectPool
.- Parameters:
user
-ManagedObjectUser
requiring 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 theManagedObject
is lost.- Parameters:
managedObject
-ManagedObject
to no longer be used.cause
- Cause for theManagedObject
to be lost.
-
empty
void empty()
Invoked on close of theOfficeFloor
to allow handling pooledManagedObject
instances.
-
-