/** Returns whether it is aborting. * * <p>The execution is aborting if {@link #getAbortingReason} returns * not null and the returned reason's {@link AbortingReason#isAborting} * is true. * * <p>Note: {@link Execution#isVoid} means the execution is voided * and no output shall be generated. The request is taken charged * by other servlet. * On the other hand, {@link #isAborting} means the execution * is aborting and the output shall still be generated (and sent). * The request is still taken charged by this execution. */ public boolean isAborting() { return _aborting != null && _aborting.isAborting(); }
Arrays.sort(tvs); for (int j = 0; j < tvs.length; ++j) responses.add(tvs[j].getResponse()); final AuResponse abtresp = _aborting.getResponse(); if (abtresp != null)
public void closeUpdate(Object ctx) throws IOException { final UpdateInfo ui = (UpdateInfo) ctx; final Execution exec = ui.uv.getExecution(); final Desktop desktop = exec.getDesktop(); ((DesktopCtrl) desktop).invokeExecutionCleanups(exec, null, null); desktop.getWebApp().getConfiguration().invokeExecutionCleanups(exec, null, null); if (ui.abrn != null) { try { ui.abrn.finish(); } catch (Throwable t) { log.warn("", t); } } doDeactivate(exec); }
public JSONArray finishUpdate(Object ctx) throws IOException { final UpdateInfo ui = (UpdateInfo) ctx; final Execution exec = ui.uv.getExecution(); final Desktop desktop = exec.getDesktop(); final List<Throwable> errs = new LinkedList<Throwable>(); //1. process events Event event = nextEvent(ui.uv); do { for (; event != null; event = nextEvent(ui.uv)) { try { process(desktop, event); } catch (Throwable ex) { handleError(ex, ui.uv, errs); } } resumeAll(desktop, ui.uv, errs); } while ((event = nextEvent(ui.uv)) != null); //2. Handle aborting reason ui.abrn = ui.uv.getAbortingReason(); if (ui.abrn != null) ui.abrn.execute(); //always execute even if !isAborting //3. Retrieve responses final List<AuResponse> responses = getResponses(exec, ui.uv, errs, false); final JSONArray rs = new JSONArray(); for (AuResponse response : responses) rs.add(AuWriters.toJSON(response)); return rs; }