/** Safe to be called even if the Web application has been destroyed */ private void safeActivate(Execution exec) { final UiEngine uieng = ((WebAppCtrl) _wapp).getUiEngine(); if (uieng != null) { uieng.activate(exec); } else { _exec = exec; ExecutionsCtrl.setCurrent(exec); } }
/** Safe to be called even if the Web application has been destroyed */ private void safeDeactivate(Execution exec) { final UiEngine uieng = ((WebAppCtrl) _wapp).getUiEngine(); if (uieng != null) { uieng.deactivate(exec); } else { _exec = null; ExecutionsCtrl.setCurrent(null); } }
/** Cleanup this process after processing the event by calling * {@link #process}. * * <p>Note: Don't call this method if the event process executes * in the same thread. */ public void cleanup() { ExecutionsCtrl.setCurrent(null); SessionsCtrl.setCurrent((Session) null); }
/** An utility to be called by {@link #renderProperties} to * render a boolean-value property if it is true. * If you want to render it no matter true or false, use * {@link ContentRenderer#render(String, boolean)} directly. * @since 5.0.0 */ protected void render(ContentRenderer renderer, String name, boolean value) throws IOException { if (value) renderer.render(name, true); }
public Collection<EventProcessingThread> getSuspendedThreads() { return ((WebAppCtrl) _wapp).getUiEngine().getSuspendedThreads(this); }
public void recoverDidFail(Throwable ex) { ((WebAppCtrl) _wapp).getDesktopCache(_sess).removeDesktop(this); }
public void sessionDestroyed(Session sess) { final SessionCtrl sessCtrl = (SessionCtrl) sess; final DesktopCache dc = sessCtrl.getDesktopCache(); if (dc != null) { sessCtrl.setDesktopCache(null); dc.stop(); } }
public String getNextUuid(Page page) { final IdGenerator idgen = ((WebAppCtrl) _wapp).getIdGenerator(); String uuid = idgen != null ? idgen.nextPageUuid(page) : null; if (uuid == null) return nextUuid(); ComponentsCtrl.checkUuid(uuid); return uuid; }
/** Renders an integer property. * @param name the property name. Note: it must be a legal JavaScript * variable name. */ public void render(String name, int value) { renderName(name); renderValue(value); }
/** Invokes {@link #getDesktopCache}'s {@link DesktopCache#sessionWillPassivate}. */ public void sessionWillPassivate(Session sess) { final DesktopCache dc = ((SessionCtrl) sess).getDesktopCache(); if (dc != null) dc.sessionWillPassivate(sess); }
/** Invokes {@link #getDesktopCache}'s {@link DesktopCache#sessionDidActivate}. */ public void sessionDidActivate(Session sess) { final DesktopCache dc = ((SessionCtrl) sess).getDesktopCache(); if (dc != null) dc.sessionDidActivate(sess); }
/** * Calculates the MD5 digest and returns the value as a 32 character hex string. * @param data data stream to digest (will not be closed) * @return MD5 digest as a hex string */ public static String md5Hex(InputStream data) throws IOException { return encodeHexString(md5(data)); }
public void destroy() { try { ((WebAppCtrl) _wapp).destroy(); } finally { _ctx.removeAttribute(ATTR_WEB_MANAGER); WebAppsCtrl.setCurrent(null); } }
/** Invokes {@link #getDesktopCacheProvider}'s * {@link DesktopCacheProvider#sessionWillPassivate}. */ public void sessionWillPassivate(Session sess) { if (_provider != null) _provider.sessionWillPassivate(sess); //Provider might be stopped before sessionDidActivate is called (Tomcat 5.5.2) }
/** Invokes {@link #getDesktopCacheProvider}'s * {@link DesktopCacheProvider#sessionDidActivate}. */ public void sessionDidActivate(Session sess) { _provider.sessionDidActivate(sess); }
/** * Returns an MD5 MessageDigest. * @return An MD5 digest instance. */ public static MessageDigest getMd5Digest() { return getDigest("MD5"); }
/** Returns the current {@link ExecutionCtrl}. */ public static final ExecutionCtrl getCurrentCtrl() { return (ExecutionCtrl) getCurrent(); }
/** Checks and returns whether the loaded document's version is correct. * It is the same as checkVersion(url, doc, false). * @since 3.5.0 */ public static boolean checkVersion(URL url, Document doc) throws Exception { return checkVersion(url, doc, false); }
/** Deactivates a thread that has invoked {@link #activate} successfully. * @since 3.0.0 * @see #activate(Desktop) * @see #activate(Desktop, long) */ public static final void deactivate(Desktop desktop) { ((DesktopCtrl) desktop).deactivateServerPush(); }
/** Renders a long property. * @param name the property name. Note: it must be a legal JavaScript * variable name. */ public void render(String name, long value) { renderName(name); renderValue(value); }