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

All Known Implementing Classes:
AsynchronousProcessor, BlockingIOCometSupport, GlassFishv2CometSupport, GlassFishWebSocketSupport, GrizzlyCometSupport, JBossWebCometSupport, Jetty7CometSupport, JettyAsyncSupportWithWebSocket, JettyCometSupport, NettyCometSupport, Servlet30AsyncSupportWithWebSocket, Servlet30CometSupport, Tomcat7AsyncSupportWithWebSocket, Tomcat7CometSupport, TomcatCometSupport

public interface AsyncSupport<E extends AtmosphereResource>

Atmosphere's supported WebServer must implement this interface in order to be auto detected by the AtmosphereFramework. If the AtmosphereFramework fail to detect the AsyncSupport, it will use a blocking thread approach to emulate Comet using the BlockingIOCometSupport.

Framework designer or Atmosphere application developer 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 AtmosphereFramework.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
 AtmosphereFramework.Action service(AtmosphereRequest req, AtmosphereResponse res)
          Serve the AtmosphereRequest and the AtmosphereResponse and return the appropriate AtmosphereFramework.Action.
 boolean supportWebSocket()
          Return true if this implementation supports the websocket protocol.
 

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

AtmosphereFramework.Action service(AtmosphereRequest req,
                                   AtmosphereResponse res)
                                   throws IOException,
                                          javax.servlet.ServletException
Serve the AtmosphereRequest and the AtmosphereResponse and return the appropriate AtmosphereFramework.Action.

Parameters:
req - the AtmosphereRequest
res - the AtmosphereResponse
Returns:
the AtmosphereFramework.Action that was manipulated by the AtmosphereHandler
Throws:
IOException
javax.servlet.ServletException

action

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

Parameters:
actionEvent - An instance of AtmosphereFramework.Action

supportWebSocket

boolean supportWebSocket()
Return true if this implementation supports the websocket protocol. return true if supported



Copyright © 2012. All Rights Reserved.