public static final char VAR_ESCAPE_CHARACTER = '\u001b';
- private final HashMap<String, OpenWindowCache> currentlyOpenWindowsInClient = new HashMap<String, OpenWindowCache>();
+ private final HashMap<Integer, OpenWindowCache> currentlyOpenWindowsInClient = new HashMap<Integer, OpenWindowCache>();
private static final int MAX_BUFFER_SIZE = 64 * 1024;
private final Application application;
- // Note that this is only accessed from synchronized block and
- // thus should be thread-safe.
- private String closingWindowName = null;
-
private List<String> locales;
private int pendingLocalesIndex;
private int maxInactiveInterval;
- private static int nextUnusedWindowSuffix = 1;
-
/**
* TODO New constructor - document me!
*
paintAfterVariableChanges(request, response, callback, repaintAll,
outWriter, root, analyzeLayouts);
- if (closingWindowName != null) {
- currentlyOpenWindowsInClient.remove(closingWindowName);
- closingWindowName = null;
- }
}
outWriter.close();
outWriter.print("\",");
}
- // If the browser-window has been closed - we do not need to paint it at
- // all
- if (root.getName().equals(closingWindowName)) {
- outWriter.print("\"changes\":[]");
- } else {
- // re-get window - may have been changed
- Root newRoot = getApplicationRoot(request, callback, application,
- root);
- if (newRoot != root) {
- root = newRoot;
- repaintAll = true;
- }
-
- writeUidlResponce(callback, repaintAll, outWriter, root,
- analyzeLayouts);
+ writeUidlResponce(callback, repaintAll, outWriter, root, analyzeLayouts);
- }
closeJsonMessage(outWriter);
outWriter.close();
JsonPaintTarget paintTarget = new JsonPaintTarget(this, outWriter,
!repaintAll);
- OpenWindowCache windowCache = currentlyOpenWindowsInClient.get(root
- .getName());
+ OpenWindowCache windowCache = currentlyOpenWindowsInClient.get(Integer
+ .valueOf(application.getRootId(root)));
if (windowCache == null) {
windowCache = new OpenWindowCache();
- currentlyOpenWindowsInClient.put(root.getName(), windowCache);
+ currentlyOpenWindowsInClient.put(
+ Integer.valueOf(application.getRootId(root)), windowCache);
}
// Paints components
}
}
// clean WindowCache
- OpenWindowCache openWindowCache = currentlyOpenWindowsInClient.get(root
- .getName());
+ OpenWindowCache openWindowCache = currentlyOpenWindowsInClient
+ .get(Integer.valueOf(application.getRootId(root)));
if (openWindowCache != null) {
openWindowCache.clear();
}
* we don't have the required logic implemented on the server side. E.g.
* a component is removed in a previous burst.
*/
- return success || closingWindowName != null;
+ return success;
}
public boolean handleVariableBurst(Object source, Application app,
if (owner instanceof Root) {
final Boolean close = (Boolean) m.get("close");
if (close != null && close.booleanValue()) {
- closingWindowName = ((Root) owner).getName();
+ throw new RuntimeException(
+ "Ensure currentlyOpenWindowsInClient is cleaned up here!");
}
}
} catch (Exception e) {