ious result was not cached so this code could // be run by multiple threads so just get the value. value = ... get value ...; cacheable = ... check if cacheable ...; extensionObject = ... get extension object ...; } else { // This thread is responsible for updating the entry, all // other threads requesting the content with the same key // is blocked waiting for this to update the entry. Object oldValue = entry.getValue(); if (oldValue == null) { // The entry is new so just get the value. value = ... get the value ...; } else { // The entry has expired and needs updating value = ... update value ...; } cacheable = ... check if cacheable ...; extensionObject = ... get extension object ...; } ProviderResult result = new ProviderResult(value, cache.getRootGroup(), cacheable, extensionObject); async.update(result); failed = false; } catch (RuntimeException e) { throwable = e; throw e; } catch (Error e) { throwable = e; throw e; } finally { if (failed) { async.failed(throwable); } } }
If the returned {@link AsyncResult} requires that an update is performedbut the caller discards the reference before updating then it will be updated with an error either after the timeout has expired, or the {@link AsyncResult} is garbage collected.
Warning: This is a facade provided for use by user code, not for implementation by user code. User implementations of this interface are highly likely to be incompatible with future releases of the product at both binary and source levels.