PushExample Class Reference

Inherits com::webobjects::appserver::WOComponent.

Collaboration diagram for PushExample:

Collaboration graph
[legend]

List of all members.

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


Constructor & Destructor Documentation

PushExample ( WOContext  context  ) 


Member Function Documentation

void appendToResponse ( WOResponse  response,
WOContext  context 
)

WOActionResults push (  ) 

String url (  ) 


Member Data Documentation

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);
                                        }
                                }
                        }
                }
        })


The documentation for this class was generated from the following file:

Generated on Sat May 26 06:42:12 2012 for Project Wonder by  doxygen 1.5.8