Package com.io7m.jpuddle.core
Interface JPPoolSynchronousType<K,T extends U,U,C>
- Type Parameters:
K- The type of keysT- The type of pooled valuesU- The type of externally visible pooled valuesC- The type of context values
- All Superinterfaces:
JPPoolSynchronousUsableType<K,T, U, C>
- All Known Implementing Classes:
JPPoolSynchronous
public interface JPPoolSynchronousType<K,T extends U,U,C>
extends JPPoolSynchronousUsableType<K,T,U,C>
The type of usable synchronous pools that yield values of type
T for
keys of type K, using context values of type C to create new
values if necessary. Only values of type U are exposed to the user:
This is to allow the pool to, for example, allocate and manipulate mutable
values internally, but only expose read-only interfaces to the user
requesting objects from the pool.-
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteSafely(C context) Delete all items in the pool and shut the pool down.voiddeleteUnsafely(C context) Delete all items in the pool and shut the pool down.Methods inherited from interface com.io7m.jpuddle.core.JPPoolSynchronousUsableType
get, isDeleted, returnValue, size, trim
-
Method Details
-
deleteSafely
Delete all items in the pool and shut the pool down. The method will refuse to delete the pool if any items are yet to be returned.- Parameters:
context- A context value- Throws:
JPPoolException- Iff any of the items in the pool have yet to be returned
-
deleteUnsafely
Delete all items in the pool and shut the pool down. The method will delete the pool even if there are items yet to be returned.- Parameters:
context- A context value- Throws:
JPPoolException- On errors
-