boolean isFirstResult = updateLatestResult(fullResult);
ViewResultListener listener = _userResultListener.get();
if (listener != null) {
ViewResultMode resultMode = getResultMode();
if (!resultMode.equals(ViewResultMode.NONE)) {
ViewComputationResultModel userFullResult = isFullResultRequired(resultMode,
isFirstResult) ? fullResult : null;
ViewDeltaResultModel userDeltaResult = isDeltaResultRequired(resultMode,
isFirstResult) ? deltaResult : null;
if (userFullResult != null || userDeltaResult != null) {
listener.cycleCompleted(userFullResult, userDeltaResult);
} else if (!isFirstResult || resultMode != ViewResultMode.DELTA_ONLY) {
// Would expect this if it's the first result and we're in delta only mode, otherwise log a warning
s_logger.warn("Ignored CycleCompleted call with no useful results to propagate");
}
}
}
}
@Override
public void cycleFragmentCompleted(ViewComputationResultModel fullFragment, ViewDeltaResultModel deltaFragment) {
ViewComputationResultModel prevResult = _latestResult.get();
ViewResultListener listener = _userResultListener.get();
if (listener != null) {
ViewResultMode resultMode = getFragmentResultMode();
if (!resultMode.equals(ViewResultMode.NONE)) {
ViewComputationResultModel userFullResult = isFullResultRequired(resultMode,
prevResult == null) ? fullFragment : null;
ViewDeltaResultModel userDeltaResult = isDeltaResultRequired(resultMode,
prevResult == null) ? deltaFragment : null;
if (userFullResult != null || userDeltaResult != null) {
listener.cycleFragmentCompleted(userFullResult, userDeltaResult);