Sun GlassFish Enterprise Server v3 Prelude Developer's Guide

The Grizzly Comet API

Grizzly's support for Comet includes a small set of APIs that make it easy to add Comet functionality to your web applications. The Grizzly Comet APIs that developers will use most often are the following:

The way a developer would use this API in a web component is to perform the following tasks:

  1. Register the context path of the application with the CometContext object:

    CometEngine cometEngine = 
    CometContext cometContext = 
  2. Register the CometHandler implementation with the CometContext object:

  3. Notify one or more CometHandler implementations when an event happens: