Changeset ceda855a in vaadin
- Timestamp:
- 03/21/12 13:27:27 (14 months ago)
- Branches:
- master, b1390c580cf5e9ad6adbb6067007d03fb69a92cc, 42c4b2097bc955ca18107c449e04f0d5d5683ca3
- Children:
- 36dca644
- Parents:
- 242b09c8
- git-author:
- Artur Signell <artur@…> (03/16/12 15:42:06)
- git-committer:
- Artur Signell <artur@…> (03/21/12 13:27:27)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java
r242b09c8 rceda855a 132 132 public static final char VAR_ESCAPE_CHARACTER = '\u001b'; 133 133 134 private final HashMap<Integer, OpenWindowCache> currentlyOpenWindowsInClient = new HashMap<Integer, OpenWindowCache>();134 private final HashMap<Integer, ClientCache> rootToClientCache = new HashMap<Integer, ClientCache>(); 135 135 136 136 private static final int MAX_BUFFER_SIZE = 64 * 1024; … … 800 800 JsonPaintTarget paintTarget = new JsonPaintTarget(this, outWriter, 801 801 !repaintAll); 802 OpenWindowCache windowCache = currentlyOpenWindowsInClient.get(Integer 803 .valueOf(root.getRootId())); 804 if (windowCache == null) { 805 windowCache = new OpenWindowCache(); 806 currentlyOpenWindowsInClient.put(Integer.valueOf(root.getRootId()), 807 windowCache); 808 } 802 ClientCache clientCache = getClientCache(root); 809 803 810 804 // TODO These seem unnecessary and could be removed/replaced by looping … … 1131 1125 boolean typeMappingsOpen = false; 1132 1126 for (Class<? extends Paintable> class1 : usedPaintableTypes) { 1133 if ( windowCache.cache(class1)) {1127 if (clientCache.cache(class1)) { 1134 1128 // client does not know the mapping key for this type, send 1135 1129 // mapping to client … … 1157 1151 dragAndDropService.printJSONResponse(outWriter); 1158 1152 } 1153 } 1154 1155 private ClientCache getClientCache(Root root) { 1156 Integer rootId = Integer.valueOf(root.getRootId()); 1157 ClientCache cache = rootToClientCache.get(rootId); 1158 if (cache == null) { 1159 cache = new ClientCache(); 1160 rootToClientCache.put(rootId, cache); 1161 } 1162 return cache; 1159 1163 } 1160 1164 … … 1270 1274 } 1271 1275 // clean WindowCache 1272 OpenWindowCache openWindowCache = currentlyOpenWindowsInClient 1273 .get(Integer.valueOf(root.getRootId())); 1274 if (openWindowCache != null) { 1275 openWindowCache.clear(); 1276 } 1276 getClientCache(root).clear(); 1277 1277 } 1278 1278 … … 2192 2192 * TODO make customlayout templates (from theme) to be cached here. 2193 2193 */ 2194 class OpenWindowCache implements Serializable {2194 class ClientCache implements Serializable { 2195 2195 2196 2196 private final Set<Object> res = new HashSet<Object>();
Note: See TracChangeset
for help on using the changeset viewer.
