org.atmosphere.samples.chat
Class MeteorChat

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by org.atmosphere.samples.chat.MeteorChat
All Implemented Interfaces:
Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class MeteorChat
extends javax.servlet.http.HttpServlet

Simple Servlet that implement the logic to build a Chat application using a Meteor to suspend and broadcast chat message.

Author:
Jeanfrancois Arcand
See Also:
Serialized Form

Constructor Summary
MeteorChat()
           
 
Method Summary
 void doGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          Create a Meteor and use it to suspend the response.
 void doPost(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          Re-use the Meteor created onthe first GET for broadcasting message.
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MeteorChat

public MeteorChat()
Method Detail

doGet

public void doGet(javax.servlet.http.HttpServletRequest req,
                  javax.servlet.http.HttpServletResponse res)
           throws IOException
Create a Meteor and use it to suspend the response.

Overrides:
doGet in class javax.servlet.http.HttpServlet
Parameters:
req - An HttpServletRequest
res - An HttpServletResponse
Throws:
IOException

doPost

public void doPost(javax.servlet.http.HttpServletRequest req,
                   javax.servlet.http.HttpServletResponse res)
            throws IOException
Re-use the Meteor created onthe first GET for broadcasting message.

Overrides:
doPost in class javax.servlet.http.HttpServlet
Parameters:
req - An HttpServletRequest
res - An HttpServletResponse
Throws:
IOException


Copyright © 2012. All Rights Reserved.