org.atmosphere.samples.chat
Class MeteorChat
java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
org.atmosphere.samples.chat.MeteorChat
- All Implemented Interfaces:
- java.io.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
|
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 |
MeteorChat
public MeteorChat()
doGet
public void doGet(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
throws java.io.IOException
- Create a
Meteor and use it to suspend the response.
- Overrides:
doGet in class javax.servlet.http.HttpServlet
- Parameters:
req - An HttpServletRequestres - An HttpServletResponse
- Throws:
java.io.IOException
doPost
public void doPost(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
throws java.io.IOException
- Re-use the
Meteor created onthe first GET for broadcasting message.
- Overrides:
doPost in class javax.servlet.http.HttpServlet
- Parameters:
req - An HttpServletRequestres - An HttpServletResponse
- Throws:
java.io.IOException
Copyright © 2011. All Rights Reserved.