public void recoverDidFail(Throwable ex) { ((WebAppCtrl) _wapp).getDesktopCache(_sess).removeDesktop(this); }
public void setId(String id) { if (!((ExecutionCtrl) _exec).isRecovering()) throw new IllegalStateException("Callable only in recovring"); if (id == null || id.length() <= 1 || id.charAt(0) != 'g') throw new IllegalArgumentException( "Invalid desktop ID. You have to recover to the original value, not creating a new value: " + id); //_sess and dc are null if in a working thread final DesktopCache dc = _sess != null ? ((WebAppCtrl) _wapp).getDesktopCache(_sess) : null; if (dc != null) dc.removeDesktop(this); _id = id; updateUuidPrefix(); if (dc != null) dc.addDesktop(this); }
/** Called to remove the desktop. * If {@link DesktopRecycle} is configured, {@link DesktopRecycle#beforeRemove} * will be called first to see if it shall be recycled. * @return whether the desktop is removed. Returns false if the desktop * is recycled. */ public static boolean removeDesktop(Execution exec) { final Desktop dt = exec.getDesktop(); final WebApp wapp = dt.getWebApp(); final DesktopRecycle dtrc = wapp.getConfiguration().getDesktopRecycle(); if (dtrc != null) { try { if (dtrc.beforeRemove(exec, dt, 0)) { ((DesktopCtrl) dt).recycle(); return false; //recycled } } catch (Throwable ex) { log.error("", ex); } } ((WebAppCtrl) wapp).getDesktopCache(dt.getSession()).removeDesktop(dt); return true; } }