Interface Depot.Factory

All Known Subinterfaces:
Enclosing class:

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:

Method Summary
 java.lang.Object create(java.lang.Object key)
          Create an object that is mapped by the given key.

Method Detail


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.

java.lang.InterruptedException - explicitly throwing this exception allows the factory to abort creating an object.