Package de.intarsys.tools.pool
Interface IPool
-
- All Known Implementing Classes:
GenericPool
public interface IPoolA pool of objects.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcheckin(java.lang.Object object)Add an object to the pool.java.lang.Objectcheckout(long timeout)Get an object from the pool.voidclose()Close the pool.voiddestroy(java.lang.Object object)Destroy an object previously allocated from the pool.
-
-
-
Method Detail
-
checkin
void checkin(java.lang.Object object) throws java.lang.ExceptionAdd 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.ExceptionGet 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.ExceptionClose the pool.- Throws:
java.lang.Exception
-
destroy
void destroy(java.lang.Object object) throws java.lang.ExceptionDestroy an object previously allocated from the pool.- Parameters:
object- The object to be destroyed.- Throws:
java.lang.Exception
-
-