* @throws CacheAccessException wrapping any unexpected exception thrown by the cache.
* @see AbstractCacheProviderFacade#onGetFromCache(Serializable,CachingModel)
*/
protected Object onGetFromCache(Serializable key, CachingModel model)
throws CacheException {
IMap cache = getCache(model);
GigaSpacesCachingModel gigaSpacesCachingModel = (GigaSpacesCachingModel) model;
Object cachedObject;
try {
Long waitForResponse = gigaSpacesCachingModel.getWaitForResponse();
if (waitForResponse != null) {
cachedObject = cache.get(key, waitForResponse.longValue());
} else {
cachedObject = cache.get(key);
}
} catch (Exception exception) {
throw new CacheAccessException(exception);
}
return cachedObject;