* @return result of Callable invocations
*/
@Override
public Object perform(InvocationContext context) throws Throwable {
// hook into lifecycle
DistributedTaskLifecycleService taskLifecycleService = DistributedTaskLifecycleService.getInstance();
Callable<V> callable = getCallable();
V result = null;
try {
taskLifecycleService.onPreExecute(callable, cache);
if (callable instanceof DistributedCallable<?, ?, ?>) {
DistributedCallable<Object, Object, Object> dc = (DistributedCallable<Object, Object, Object>) callable;
dc.setEnvironment(cache, keys);
}
result = callable.call();
} finally {
taskLifecycleService.onPostExecute(callable);
}
return result;
}