com.sun.grizzly.grizzlet
Class ChatGrizzlet

java.lang.Object
  extended by com.sun.grizzly.grizzlet.ChatGrizzlet
All Implemented Interfaces:
Grizzlet

public class ChatGrizzlet
extends Object
implements Grizzlet

Simple Grizzlet that implement the logic to build a Chat application.

Author:
Jeanfrancois Arcand

Constructor Summary
ChatGrizzlet()
           
 
Method Summary
 void onPush(AsyncConnection ac)
          This method is invoked when the Grizzlet Container execute a push operations.
 void onRequest(AsyncConnection ac)
          When a client send a request to its associated Grizzlet, it can decide if the underlying connection can be suspended (creating a Continuation) or handle the connection synchronously.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChatGrizzlet

public ChatGrizzlet()
Method Detail

onRequest

public void onRequest(AsyncConnection ac)
               throws IOException
Description copied from interface: Grizzlet
When a client send a request to its associated Grizzlet, it can decide if the underlying connection can be suspended (creating a Continuation) or handle the connection synchronously. It is recommended to only suspend request for which HTTP method is a GET and use the POST method to send data to the server, without marking the connection as asynchronous.

Specified by:
onRequest in interface Grizzlet
Parameters:
ac - An object representing an asynchronous connection.
Throws:
IOException

onPush

public void onPush(AsyncConnection ac)
            throws IOException
Description copied from interface: Grizzlet
This method is invoked when the Grizzlet Container execute a push operations. When this method is invoked by the Grizzlet Container, any suspended connection will be allowed to push the data back to its associated clients.

Specified by:
onPush in interface Grizzlet
Parameters:
ac - An object representing an asynchronous connection.
Throws:
IOException


Copyright © 2010 SUN Microsystems. All Rights Reserved.