com.sun.grizzly.comet
Interface CometHandler<E>

All Known Subinterfaces:
CometdHandler, CometHandler<E>
All Known Implementing Classes:
AjaxCometServlet.ChatListnerHandler, BayeuxCometHandler, BayeuxCometHandlerBase, CometServlet.CometRequestHandler, CometServlet.CometRequestHandler, DataHandler, GrizzletCometHandler, MessagesBusCometHandler

public interface CometHandler<E>

This interface allow Java components part of an HTTP request to be polled by the Grizzly Asynchronous Request Mechanism. Components that implement this interface will be notified when another CometHandler notify them using CometContext.notify. With Servlet, it is recommended to attach the HTTPServletResponse and use this object to push back bytes to the client.

Author:
Jeanfrancois Arcand

Method Summary
 void attach(E attachment)
          Attach an intance of E to this class.
 void onEvent(CometEvent event)
          Receive CometEvent notification.
 void onInitialize(CometEvent event)
          Receive CometEvent notification when the underlying tcp communication is started by the client
 void onInterrupt(CometEvent event)
          Receive CometEvent notification when the underlying tcp communication is resumed by the Grizzly ARP.
 void onTerminate(CometEvent event)
          Receive CometEvent notification when the underlying tcp communication is closed by the CometHandler
 

Method Detail

attach

void attach(E attachment)
Attach an intance of E to this class.


onEvent

void onEvent(CometEvent event)
             throws IOException
Receive CometEvent notification.

Throws:
IOException

onInitialize

void onInitialize(CometEvent event)
                  throws IOException
Receive CometEvent notification when the underlying tcp communication is started by the client

Throws:
IOException

onTerminate

void onTerminate(CometEvent event)
                 throws IOException
Receive CometEvent notification when the underlying tcp communication is closed by the CometHandler

Throws:
IOException

onInterrupt

void onInterrupt(CometEvent event)
                 throws IOException
Receive CometEvent notification when the underlying tcp communication is resumed by the Grizzly ARP.

Throws:
IOException


Copyright © 2010 SUN Microsystems. All Rights Reserved.