com.sun.grizzly.cometd
Class DataHandler

java.lang.Object
  extended by com.sun.grizzly.cometd.DataHandler
All Implemented Interfaces:
CometHandler<Object[]>

public class DataHandler
extends Object
implements CometHandler<Object[]>

CometHandler used to support the meta channel Verb Connect and Reconnect. The DataHandler is holding the state of the long polled (Comet) connection.

Author:
Jeanfrancois Arcand, TAKAI, Naoto

Constructor Summary
DataHandler(BayeuxParser bayeuxParser)
           
 
Method Summary
 void addChannel(String channel)
           
 void attach(Object[] reqRes)
           
 boolean containsChannel(String channel)
           
 Collection<String> getChannels()
           
 int getRemotePort()
           
 boolean isSuspended()
           
 void onEvent(CometEvent event)
           
 void onInitialize(CometEvent event)
           
 void onInterrupt(CometEvent event)
           
 void onTerminate(CometEvent event)
           
 boolean removeChannel(String channel)
           
 void setSuspended(boolean isSuspended)
           
protected  void write(String s, CometdResponse res, boolean flush)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataHandler

public DataHandler(BayeuxParser bayeuxParser)
Method Detail

write

protected void write(String s,
                     CometdResponse res,
                     boolean flush)
              throws IOException
Throws:
IOException

attach

public void attach(Object[] reqRes)
Specified by:
attach in interface CometHandler<Object[]>

onEvent

public void onEvent(CometEvent event)
             throws IOException
Specified by:
onEvent in interface CometHandler<Object[]>
Throws:
IOException

onInitialize

public void onInitialize(CometEvent event)
                  throws IOException
Specified by:
onInitialize in interface CometHandler<Object[]>
Throws:
IOException

onTerminate

public void onTerminate(CometEvent event)
                 throws IOException
Specified by:
onTerminate in interface CometHandler<Object[]>
Throws:
IOException

onInterrupt

public void onInterrupt(CometEvent event)
                 throws IOException
Specified by:
onInterrupt in interface CometHandler<Object[]>
Throws:
IOException

getChannels

public Collection<String> getChannels()

addChannel

public void addChannel(String channel)

containsChannel

public boolean containsChannel(String channel)

removeChannel

public boolean removeChannel(String channel)

isSuspended

public boolean isSuspended()

setSuspended

public void setSuspended(boolean isSuspended)

getRemotePort

public int getRemotePort()


Copyright © 2009 SUN Microsystems. All Rights Reserved.