org.wamblee.cache
Interface CachedObject.Computation<Key extends Serializable,Value extends Serializable>

Type Parameters:
T - Type of the object
Enclosing class:
CachedObject<KeyType extends Serializable,ValueType extends Serializable>

public static interface CachedObject.Computation<Key extends Serializable,Value extends Serializable>

Callback invoked to compute an object if it was not found in the cache.


Method Summary
 Value getObject(Key aObjectKey)
          Gets the object.
 

Method Detail

getObject

Value getObject(Key aObjectKey)
                                     throws Exception
Gets the object. Called when the object is not in the cache. In case computation fails, an exception should be thrown to ensure that the last known value will be used.

Parameters:
aObjectKey - Id of the object in the cache.
Returns:
Object, must be non-null.
Throws:
Exception


Copyright © 2011. All Rights Reserved.