From 64075d9078052c5ac9446d6aab2debe8a46ccfba Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Mon, 19 Nov 2012 20:12:01 +0200 Subject: [PATCH] Renamed suspend/resumeRendering be more descriptive (#10242) Change-Id: I817fdab5529b0192f58e76ea31b97efb18b3f881 --- .../vaadin/client/ApplicationConnection.java | 35 +++++++++---------- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/client/src/com/vaadin/client/ApplicationConnection.java b/client/src/com/vaadin/client/ApplicationConnection.java index 48815a3d8d..4c3eaff6aa 100644 --- a/client/src/com/vaadin/client/ApplicationConnection.java +++ b/client/src/com/vaadin/client/ApplicationConnection.java @@ -219,10 +219,10 @@ public class ApplicationConnection { private final RpcManager rpcManager; /** - * If renderingLocks contains any objects, rendering is to be suspended - * until the collection is empty or a timeout has occurred. + * If responseHandlingLocks contains any objects, response handling is + * suspended until the collection is empty or a timeout has occurred. */ - private Set renderingLocks = new HashSet(); + private Set responseHandlingLocks = new HashSet(); /** * Data structure holding information about pending UIDL messages. @@ -251,10 +251,10 @@ public class ApplicationConnection { } } - /** Contains all UIDL messages received while the rendering is suspended */ + /** Contains all UIDL messages received while response handling is suspended */ private List pendingUIDLMessages = new ArrayList(); - /** The max timeout the rendering phase may be suspended */ + /** The max timeout that response handling may be suspended */ private static final int MAX_SUSPENDED_TIMEOUT = 5000; /** Event bus for communication events */ @@ -1242,7 +1242,7 @@ public class ApplicationConnection { protected void handleUIDLMessage(final Date start, final String jsonText, final ValueMap json) { - if (!renderingLocks.isEmpty()) { + if (!responseHandlingLocks.isEmpty()) { // Some component is doing something that can't be interrupted // (e.g. animation that should be smooth). Enqueue the UIDL // message for later processing. @@ -3077,14 +3077,14 @@ public class ApplicationConnection { } /** - * Timer used to make sure that no misbehaving components can lock the - * rendering phase forever. + * Timer used to make sure that no misbehaving components can delay response + * handling forever. */ Timer forceHandleMessage = new Timer() { @Override public void run() { - VConsole.log("WARNING: rendering was never resumed, forcing reload..."); - renderingLocks.clear(); + VConsole.log("WARNING: reponse handling was never resumed, forcibly removing locks..."); + responseHandlingLocks.clear(); handlePendingMessages(); } }; @@ -3095,8 +3095,8 @@ public class ApplicationConnection { * * @param lock */ - public void suspendRendering(Object lock) { - renderingLocks.add(lock); + public void suspendReponseHandling(Object lock) { + responseHandlingLocks.add(lock); } /** @@ -3104,18 +3104,17 @@ public class ApplicationConnection { * * @param lock */ - public void resumeRendering(Object lock) { - VConsole.log("...resuming UIDL handling."); - renderingLocks.remove(lock); - if (renderingLocks.isEmpty()) { - VConsole.log("No more rendering locks, rendering pending requests."); + public void resumeResponseHandling(Object lock) { + responseHandlingLocks.remove(lock); + if (responseHandlingLocks.isEmpty()) { + VConsole.log("No more response handling locks, handling pending requests."); forceHandleMessage.cancel(); handlePendingMessages(); } } /** - * Handles all pending UIDL messages queued while the rendering was + * Handles all pending UIDL messages queued while response handling was * suspended. */ private void handlePendingMessages() { -- 2.39.5