org.atmosphere.container
Class Tomcat7BIOSupportWithWebSocket

java.lang.Object
  extended by org.atmosphere.cpr.AsynchronousProcessor
      extended by org.atmosphere.container.BlockingIOCometSupport
          extended by org.atmosphere.container.Tomcat7BIOSupportWithWebSocket
All Implemented Interfaces:
TomcatWebSocketUtil.Delegate, AsyncSupport<AtmosphereResourceImpl>

public class Tomcat7BIOSupportWithWebSocket
extends BlockingIOCometSupport
implements TomcatWebSocketUtil.Delegate

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.container.BlockingIOCometSupport
LATCH
 
Fields inherited from class org.atmosphere.cpr.AsynchronousProcessor
cancelledAction, config, timedoutAction
 
Constructor Summary
Tomcat7BIOSupportWithWebSocket(AtmosphereConfig config)
           
 
Method Summary
 Action doService(AtmosphereRequest req, AtmosphereResponse res)
           
 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.
 
Methods inherited from class org.atmosphere.container.BlockingIOCometSupport
action, cancelled, complete, suspend
 
Methods inherited from class org.atmosphere.cpr.AsynchronousProcessor
allowSessionTimeoutRemoval, completeLifecycle, getContainerName, init, invokeAtmosphereHandler, map, resumed, shutdown, supportSession, suspended, timedout
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.atmosphere.container.TomcatWebSocketUtil.Delegate
suspended
 

Constructor Detail

Tomcat7BIOSupportWithWebSocket

public Tomcat7BIOSupportWithWebSocket(AtmosphereConfig config)
Method Detail

service

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

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

doService

public Action doService(AtmosphereRequest req,
                        AtmosphereResponse res)
                 throws IOException,
                        javax.servlet.ServletException
Specified by:
doService in interface TomcatWebSocketUtil.Delegate
Throws:
IOException
javax.servlet.ServletException

supportWebSocket

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

Specified by:
supportWebSocket in interface AsyncSupport<AtmosphereResourceImpl>
Overrides:
supportWebSocket in class AsynchronousProcessor
Returns:
true if supported


Copyright © 2014. All Rights Reserved.