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

All Known Implementing Classes:
AsynchronousProcessor, BlockingIOCometSupport, GlassFishv2CometSupport, GlassFishWebSocketSupport, Grizzly2CometSupport, Grizzly2WebSocketSupport, GrizzlyCometSupport, JBossWebCometSupport, Jetty7CometSupport, JettyAsyncSupportWithWebSocket, JettyCometSupport, JettyServlet30AsyncSupportWithWebSocket, NettyCometSupport, Servlet30CometSupport, Tomcat7AsyncSupportWithWebSocket, Tomcat7BIOSupportWithWebSocket, Tomcat7CometSupport, Tomcat7Servlet30SupportWithWebSocket, 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 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
 Action service(AtmosphereRequest req, AtmosphereResponse res)
          Serve the AtmosphereRequest and the AtmosphereResponse and return the appropriate 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

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

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

action

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

Parameters:
actionEvent - An instance of Action

supportWebSocket

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



Copyright © 2013. All Rights Reserved.