com.go.trove.util
Interface Depot.Factory
- All Known Subinterfaces:
- Depot.PerishablesFactory
- Enclosing class:
- Depot
- public static interface Depot.Factory
Implement this interface in order for Depot to retrieve objects when
needed, often in a thread other than the requester's.
- See Also:
PerishablesFactory
|
Method Summary |
java.lang.Object |
create(java.lang.Object key)
Create an object that is mapped by the given key. |
create
public java.lang.Object create(java.lang.Object key)
throws java.lang.InterruptedException
- Create an object that is mapped by the given key. This method must
be thread-safe, but simply making it synchronized may severely
impact the Depot's support of concurrent activity.
Create may abort its operation by throwing an InterruptedException.
This forces an invalid object to be used or null if none. If an
InterruptedException is thrown, nether the invalid object or null
will be cached. Null is cached only if the factory returns it
directly.
- Throws:
java.lang.InterruptedException - explicitly throwing this exception
allows the factory to abort creating an object.