org.atmosphere.container
Class Tomcat7AsyncSupportWithWebSocket

java.lang.Object
  extended by org.atmosphere.cpr.AsynchronousProcessor
      extended by org.atmosphere.container.Servlet30CometSupport
          extended by org.atmosphere.container.Tomcat7AsyncSupportWithWebSocket
All Implemented Interfaces:
AsyncSupport<AtmosphereResourceImpl>

public class Tomcat7AsyncSupportWithWebSocket
extends Servlet30CometSupport

Tomcat's WebSocket support. This code has been adapted from WebSocketServlet


Nested Class Summary
 
Nested classes/interfaces inherited from class org.atmosphere.cpr.AsynchronousProcessor
AsynchronousProcessor.AsynchronousProcessorHook
 
Field Summary
 
Fields inherited from class org.atmosphere.cpr.AsynchronousProcessor
aliveRequests, cancelledAction, config, timedoutAction
 
Constructor Summary
Tomcat7AsyncSupportWithWebSocket(AtmosphereConfig config)
           
 
Method Summary
 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.
 
Methods inherited from class org.atmosphere.container.Servlet30CometSupport
action, getContainerName
 
Methods inherited from class org.atmosphere.cpr.AsynchronousProcessor
cancelled, destroyResource, map, map, resumed, shutdown, supportSession, suspended, timedout
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Tomcat7AsyncSupportWithWebSocket

public Tomcat7AsyncSupportWithWebSocket(AtmosphereConfig config)
Method Detail

init

public void init(javax.servlet.ServletConfig sc)
          throws javax.servlet.ServletException
Description copied from interface: AsyncSupport
Initialize the WebServer using the ServletConfig

Specified by:
init in interface AsyncSupport<AtmosphereResourceImpl>
Overrides:
init in class AsynchronousProcessor
Parameters:
sc - the ServletConfig
Throws:
javax.servlet.ServletException

service

public AtmosphereFramework.Action service(AtmosphereRequest req,
                                          AtmosphereResponse res)
                                   throws IOException,
                                          javax.servlet.ServletException
Description copied from class: Servlet30CometSupport
Serve the AtmosphereRequest and the AtmosphereResponse and return the appropriate AtmosphereFramework.Action.

Specified by:
service in interface AsyncSupport<AtmosphereResourceImpl>
Overrides:
service in class Servlet30CometSupport
Parameters:
req - the AtmosphereRequest
res - the AtmosphereResponse
Returns:
the AtmosphereFramework.Action that was manipulated by the AtmosphereHandler
Throws:
IOException
javax.servlet.ServletException

supportWebSocket

public boolean supportWebSocket()
Description copied from interface: AsyncSupport
Return true if this implementation supports the websocket protocol. return true if supported

Specified by:
supportWebSocket in interface AsyncSupport<AtmosphereResourceImpl>
Overrides:
supportWebSocket in class AsynchronousProcessor


Copyright © 2012. All Rights Reserved.