org.atmosphere.cpr
Class WebContainer

java.lang.Object
  extended by org.atmosphere.cpr.WebContainer
Direct Known Subclasses:
BlockingIOCometSupport, GlassFishv2CometSupport, GrizzlyCometSupport, JettyCometSupport, Servlet30Support, TomcatCometSupport, WebLogicCometSupport

public abstract class WebContainer
extends Object

Base class which implement the semantics of supending and resuming of a Comet Request.

Author:
Jeanfrancois Arcand

Field Summary
protected  Map<String,AtmosphereServlet.AtmosphereHandlerWrapper> atmosphereHandlers
           
protected static String EVENT
           
protected  Logger logger
           
 
Constructor Summary
WebContainer(Map<String,AtmosphereServlet.AtmosphereHandlerWrapper> atmosphereHandlers)
           
 
Method Summary
 void init(ServletConfig sc)
          Init this WebContainer.
 AtmosphereServlet.Action resumed(HttpServletRequest req, HttpServletResponse res)
          All proprietary Comet based Servlet must invoke the resume method when the Atmosphere's application decide to resume the HttpServletResponse.
protected  void setWebServerName(String webServerName)
          Set the WebServer's name.
 AtmosphereServlet.Action suspended(HttpServletRequest req, HttpServletResponse res)
          All proprietary Comet based Servlet must invoke the suspended method when the first request comes in.
 AtmosphereServlet.Action timedout(HttpServletRequest req, HttpServletResponse res)
          All proprietary Comet based Servlet must invoke the timedout method when the underlying WebServer time out the HttpServletResponse.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected Logger logger

atmosphereHandlers

protected final Map<String,AtmosphereServlet.AtmosphereHandlerWrapper> atmosphereHandlers

EVENT

protected static final String EVENT
See Also:
Constant Field Values
Constructor Detail

WebContainer

public WebContainer(Map<String,AtmosphereServlet.AtmosphereHandlerWrapper> atmosphereHandlers)
Method Detail

init

public void init(ServletConfig sc)
          throws ServletException
Init this WebContainer.

Parameters:
sc - the ServletContext
Throws:
ServletException

suspended

public AtmosphereServlet.Action suspended(HttpServletRequest req,
                                          HttpServletResponse res)
                                   throws IOException,
                                          ServletException
All proprietary Comet based Servlet must invoke the suspended method when the first request comes in. The returned value, of type Atmosphere#Action, tells the proprietary Comet Servlet to suspended or not the current HttpServletResponse.

Parameters:
req - the HttpServletRequest
res - the HttpServletResponse
Returns:
action the Action operation.
Throws:
IOException
ServletException

resumed

public AtmosphereServlet.Action resumed(HttpServletRequest req,
                                        HttpServletResponse res)
                                 throws IOException,
                                        ServletException
All proprietary Comet based Servlet must invoke the resume method when the Atmosphere's application decide to resume the HttpServletResponse. The returned value, of type Atmosphere#Action, tells the proprietary Comet Servlet to resume (again), suspended or do nothing with the current HttpServletResponse.

Parameters:
req - the HttpServletRequest
res - the HttpServletResponse
Returns:
action the Action operation.
Throws:
IOException
ServletException

timedout

public AtmosphereServlet.Action timedout(HttpServletRequest req,
                                         HttpServletResponse res)
                                  throws IOException,
                                         ServletException
All proprietary Comet based Servlet must invoke the timedout method when the underlying WebServer time out the HttpServletResponse. The returned value, of type Atmosphere#Action, tells the proprietary Comet Servlet to resume (again), suspended or do nothing with the current HttpServletResponse.

Parameters:
req - the HttpServletRequest
res - the HttpServletResponse
Returns:
action the Action operation.
Throws:
IOException
ServletException

setWebServerName

protected void setWebServerName(String webServerName)
Set the WebServer's name.

Parameters:
webServerName - the WebServer's name.


Copyright © 2009 SUN Microsystems. All Rights Reserved.