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<Object> renderingLocks = new HashSet<Object>();
+ private Set<Object> responseHandlingLocks = new HashSet<Object>();
/**
* Data structure holding information about pending UIDL messages.
}
}
- /** Contains all UIDL messages received while the rendering is suspended */
+ /** Contains all UIDL messages received while response handling is suspended */
private List<PendingUIDLMessage> pendingUIDLMessages = new ArrayList<PendingUIDLMessage>();
- /** 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 */
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.
}
/**
- * 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();
}
};
*
* @param lock
*/
- public void suspendRendering(Object lock) {
- renderingLocks.add(lock);
+ public void suspendReponseHandling(Object lock) {
+ responseHandlingLocks.add(lock);
}
/**
*
* @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() {