Package de.intarsys.tools.pool
Interface IPool
-
- All Known Implementing Classes:
GenericPool
public interface IPool
A pool of objects.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
checkin(java.lang.Object object)
Add an object to the pool.java.lang.Object
checkout(long timeout)
Get an object from the pool.void
close()
Close the pool.void
destroy(java.lang.Object object)
Destroy an object previously allocated from the pool.
-
-
-
Method Detail
-
checkin
void checkin(java.lang.Object object) throws java.lang.Exception
Add an object to the pool.- Parameters:
object
- The object to be added to the pool.- Throws:
java.lang.Exception
-
checkout
java.lang.Object checkout(long timeout) throws java.lang.Exception
Get an object from the pool.This may be a reused object or a new one, up to the pool strategy and size.
- Parameters:
timeout
- The maximum time to wait for an instance to be available in milliseconds. -1 will wait indefinitely, 0 will not wait.- Returns:
- A new object from the pool.
- Throws:
java.lang.Exception
-
close
void close() throws java.lang.Exception
Close the pool.- Throws:
java.lang.Exception
-
destroy
void destroy(java.lang.Object object) throws java.lang.Exception
Destroy an object previously allocated from the pool.- Parameters:
object
- The object to be destroyed.- Throws:
java.lang.Exception
-
-