/** * Execute a task and aim the output at a specific script session. This * method is likely to be useful for directed updates that originate away * from a thread started by the browser window in question. Examples include * an instant message, or the results of a slow method invocation. * This method is implicit in anything called from a DWR thread, so should * not need to be used to send UI updates back to an originating browser. * @param sessionId The {@link ScriptSession}.id of the browser window * @param task A code block to execute */ public static void withSession(String sessionId, Runnable task) { withSession(getServerContext(), sessionId, task); }