
Public Member Functions | |
| void | appendToResponse (WOResponse response, WOContext context) |
| WOActionResults | push () |
| PushExample (WOContext context) | |
| String | url () |
Static Private Attributes | |
| static Set< String > | _pushSessionIDs = Collections.synchronizedSet(new HashSet<String>()) |
| static Thread | _pushThread |
| PushExample | ( | WOContext | context | ) |
| void appendToResponse | ( | WOResponse | response, | |
| WOContext | context | |||
| ) |
| WOActionResults push | ( | ) |
| String url | ( | ) |
Set<String> _pushSessionIDs = Collections.synchronizedSet(new HashSet<String>()) [static, private] |
Thread _pushThread [static, private] |
Initial value:
new Thread(new Runnable() { public void run() { boolean running = true; while (running) { Set<String> pushSessionIDs = new HashSet<String>(_pushSessionIDs); for (String pushSessionID : pushSessionIDs) { if (AjaxPushRequestHandler.isResponseOpen(pushSessionID, "test")) { String str = "<br>push to '" + pushSessionID+ "': " + System.currentTimeMillis(); System.out.println("ERXKeepAliveResponse.push: sending '" + str + "'"); AjaxPushRequestHandler.push(pushSessionID, "test", str); try { Thread.sleep(2000); } catch (InterruptedException e) { running = false; } } else { System.out.println("PushExample._pushThread.new Runnable() {...}.run: removing " + pushSessionID); _pushSessionIDs.remove(pushSessionID); } } } } })
1.5.8