boolean bDead = _desktop == null || !_desktop.isAlive(); if (bTimeout || bDead) { //not timeout
public void stop() { if (_desktop == null) { log.warn("Ignored: Sever-push not started"); return; } final Execution exec = Executions.getCurrent(); final boolean inexec = exec != null && exec.getDesktop() == _desktop; //it might be caused by DesktopCache expunge (when creating another desktop) try { if (inexec && _desktop.isAlive()) //Bug 1815480: don't send if timeout stopClientPush(); } finally { _desktop = null; //to cause DesktopUnavailableException being thrown wakePending(); //if inexec, either in working thread, or other event listener //if in working thread, we cannot notify here (too early to wake). //if other listener, no need notify (since onPiggyback not running) if (!inexec) { synchronized (_mutex) { _mutex.notify(); //wake up onPiggyback } } } }
boolean bDead = _desktop == null || !_desktop.isAlive(); if (bTimeout || bDead) { //not timeout
boolean bDead = _desktop == null || !_desktop.isAlive(); if (bTimeout || bDead) { //not timeout
/** * Terminate a {@linkplain OperationThread} which is stored in desktop and clear it. * * @param desktop the associated desktop */ public static void destroyWith(Desktop desktop) { if (desktop == null){ throw new NullPointerException("desktop is null"); } if(D.ON && log.debugable()){ log.debug("destory a Operation Thread for desktop:"+desktop); } synchronized(desktop) { if (desktop.isAlive()) {// destroy desktop if it still alive. OperationThread t = (OperationThread) desktop .getAttribute(DESKTOP_KEY); desktop.removeAttribute(DESKTOP_KEY); if (t != null && t.isRunning()) { t.terminate(); } } } }
/** * Get the {@link OperationQueue} of {@linkplain OperationThread}, * It is check is there any {@linkplain OperationThread} exist in desktop. * If no, create one ,start it and store in desktop, then return thread's operation queue. * If yes, return operation queue directly. * * There is only one {@linkplain OperationThread} in each desktop. * @param desktop the associated desktop * @return a queue which associate to desktop */ public static OperationQueue getQueue(Desktop desktop) { if (desktop == null) throw new NullPointerException("desktop is null"); synchronized(desktop) { if (!desktop.isAlive()) { throw new IllegalStateException("desktop not alive:" + desktop); } OperationThread t = (OperationThread) desktop.getAttribute(DESKTOP_KEY); if (t == null) { t = new OperationThread(desktop); if(D.ON && log.debugable()){ log.debug("staring a Operation Thread for desktop:"+desktop+",name="+t.getName()); } desktop.setAttribute(DESKTOP_KEY, t); t.start(); } return t.getQueue(); } }
if (page == null || !page.isAlive()) { String msg = (page == null ? "No page is available in " + desktop : "Page " + page + " was destroyed"); if (desktop.isAlive()) msg += " (but desktop is alive)"; else
synchronized (uvlock) { for (boolean tried = false;;) { if (!desktop.isAlive()) throw new org.zkoss.zk.ui.DesktopUnavailableException( "Unable to activate destroyed desktop, " + desktop);
int failCount = 0; while (_running) { if(!_desktop.isAlive()){ throw new DesktopUnavailableException( "Desktop is not alive"+_desktop);