org.atmosphere.gwt.client.impl
Class OperaEventSourceCometTransport

java.lang.Object
  extended by org.atmosphere.gwt.client.impl.BaseCometTransport
      extended by org.atmosphere.gwt.client.impl.OperaEventSourceCometTransport
All Implemented Interfaces:
CometTransport

public class OperaEventSourceCometTransport
extends BaseCometTransport

This class uses Opera's event-source element to stream events.
http://my.opera.com/WebApplications/blog/show.dml/438711

The main issue with Opera's implementation is that we can't detect connection events. To support this three event listeners are setup: one "s" for string messages, one "o" for the GWT serialized object messages, and the other "c" for connection events. The server sends the event "c" as soon as the connection is established and "d" when the connection is terminated. A connection timer is setup to detect initial connection errors. To detect subsequent connection failure it also sends a heart beat events "h" when no messages have been sent for a specified heart beat interval.

Author:
Richard Zschech

Nested Class Summary
 
Nested classes/interfaces inherited from class org.atmosphere.gwt.client.impl.BaseCometTransport
BaseCometTransport.RPCServerTransport
 
Field Summary
 
Fields inherited from class org.atmosphere.gwt.client.impl.BaseCometTransport
client, connectionId, listener, serverTransport
 
Constructor Summary
OperaEventSourceCometTransport()
           
 
Method Summary
 void connect(int connectionCount)
           
 void disconnect()
           
 void initiate(AtmosphereClient client, AtmosphereListener listener)
           
 
Methods inherited from class org.atmosphere.gwt.client.impl.BaseCometTransport
addUrlParameter, broadcast, broadcast, getServerTransport, getUrl, parse, post, post
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OperaEventSourceCometTransport

public OperaEventSourceCometTransport()
Method Detail

initiate

public void initiate(AtmosphereClient client,
                     AtmosphereListener listener)
Specified by:
initiate in interface CometTransport
Overrides:
initiate in class BaseCometTransport

connect

public void connect(int connectionCount)

disconnect

public void disconnect()
Specified by:
disconnect in interface CometTransport
Overrides:
disconnect in class BaseCometTransport


Copyright © 2013. All Rights Reserved.