org.atmosphere.cpr
Interface CometSupport<E extends AtmosphereResource>

All Known Implementing Classes:
AsynchronousProcessor, BlockingIOCometSupport, GlassFishv2CometSupport, GoogleAppEngineCometSupport, GrizzlyCometSupport, JBossWebCometSupport, Jetty7CometSupport, JettyCometSupport, Servlet30Support, TomcatCometSupport, WebLogicCometSupport

public interface CometSupport<E extends AtmosphereResource>

Atmosphere's supported WebServer must implement this interface in order to be auto detected by the AtmosphereServlet. If the AtmosphereServlet fail to detect the CometSupport, it will use a blocking thread approach to emulate Comet using the BlockingIOCometSupport. Framework designer or Atmosphere application developper can also add their own implementation of that class by referencing their class within the atmosphere.xml file:


 <<atmosphere-handler ... comet-support="your.class.name">
 

Author:
Jeanfrancois Arcand

Method Summary
 void action(E actionEvent)
          Process an AtmosphereServlet.Action from an ActionEvent operation like suspend, resume or timed out.
 String getContainerName()
          Return the name of the Java Web Server.
 void init(javax.servlet.ServletConfig sc)
          Initialize the WebServer using the ServletConfig
 AtmosphereServlet.Action service(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          Serve the HttpServletRequest and the HttpServletResponse and return the appropriate AtmosphereServlet.Action.
 

Method Detail

getContainerName

String getContainerName()
Return the name of the Java Web Server.

Returns:
the name of the Java Web Server.

init

void init(javax.servlet.ServletConfig sc)
          throws javax.servlet.ServletException
Initialize the WebServer using the ServletConfig

Parameters:
sc - the ServletConfig
Throws:
javax.servlet.ServletException

service

AtmosphereServlet.Action service(javax.servlet.http.HttpServletRequest req,
                                 javax.servlet.http.HttpServletResponse res)
                                 throws IOException,
                                        javax.servlet.ServletException
Serve the HttpServletRequest and the HttpServletResponse and return the appropriate AtmosphereServlet.Action.

Parameters:
req - the HttpServletRequest
res - the HttpServletResponse
Returns:
the AtmosphereServlet.Action that was manipulated by the AtmosphereHandler
Throws:
IOException
javax.servlet.ServletException

action

void action(E actionEvent)
Process an AtmosphereServlet.Action from an ActionEvent operation like suspend, resume or timed out.

Parameters:
actionEvent - An instance of AtmosphereServlet.Action


Copyright © 2010 SUN Microsystems. All Rights Reserved.