import java.util.Collection;
import java.util.Date;
import java.util.Enumeration;
-import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
UIDLTransformer transformer = null;
HttpVariableMap variableMap = null;
OutputStream out = response.getOutputStream();
- HashSet currentlyDirtyWindowsForThisApplication = new HashSet();
+ WeakHashMap currentlyDirtyWindowsForThisApplication = new WeakHashMap();
Application application = null;
try {
paintTarget.close();
// For exception handling, memorize the current dirty status
- Collection dirtyWindows = (Collection) applicationToDirtyWindowSetMap
+ WeakHashMap dirtyWindows = (WeakHashMap) applicationToDirtyWindowSetMap
.get(application);
+
if (dirtyWindows == null) {
- dirtyWindows = new HashSet();
+ dirtyWindows = new WeakHashMap();
applicationToDirtyWindowSetMap.put(application,
dirtyWindows);
}
currentlyDirtyWindowsForThisApplication
- .addAll(dirtyWindows);
+ .putAll((Map) dirtyWindows);
// Window is now painted
windowPainted(application, window);
// to make sure that eventually they are repainted
Application currentApplication = getApplication(request);
for (Iterator iter = currentlyDirtyWindowsForThisApplication
- .iterator(); iter.hasNext();) {
+ .keySet().iterator(); iter.hasNext();) {
Window dirtyWindow = (Window) iter.next();
addDirtyWindow(currentApplication, dirtyWindow);
}
*/
protected void addDirtyWindow(Application application, Window window) {
synchronized (applicationToDirtyWindowSetMap) {
- HashSet dirtyWindows = (HashSet) applicationToDirtyWindowSetMap
+ WeakHashMap dirtyWindows = (WeakHashMap) applicationToDirtyWindowSetMap
.get(application);
if (dirtyWindows == null) {
- dirtyWindows = new HashSet();
+ dirtyWindows = new WeakHashMap();
applicationToDirtyWindowSetMap.put(application, dirtyWindows);
}
- dirtyWindows.add(window);
+ dirtyWindows.put(window, Boolean.TRUE);
}
}
*/
protected void removeDirtyWindow(Application application, Window window) {
synchronized (applicationToDirtyWindowSetMap) {
- HashSet dirtyWindows = (HashSet) applicationToDirtyWindowSetMap
+ WeakHashMap dirtyWindows = (WeakHashMap) applicationToDirtyWindowSetMap
.get(application);
if (dirtyWindows != null)
dirtyWindows.remove(window);
* @param app
* @return
*/
- protected Set getDirtyWindows(Application app) {
- HashSet dirtyWindows;
+ protected Map getDirtyWindows(Application app) {
+ WeakHashMap dirtyWindows;
synchronized (applicationToDirtyWindowSetMap) {
- dirtyWindows = (HashSet) applicationToDirtyWindowSetMap.get(app);
+ dirtyWindows = (WeakHashMap) applicationToDirtyWindowSetMap
+ .get(app);
}
- return dirtyWindows;
+ return (Map) dirtyWindows;
}
/**
} else {
// Application still alive - keep updating windows
- Set dws = getDirtyWindows(application);
+ Map dws = getDirtyWindows(application);
if (dws != null && !dws.isEmpty()) {
// For one of the dirty windows (in each
// application)
// request redraw
- Window win = (Window) dws.iterator().next();
+ Window win = (Window) dws.keySet().iterator()
+ .next();
w
.println("<script>\n"
+ ThemeFunctionLibrary
// Sends the generated commands and newline immediately to
// browser
+ // TODO why space in here? why not plain ln?
w.println(" ");
w.flush();
response.flushBuffer();