org.atmosphere.container
Class Tomcat7CometSupport

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

public class Tomcat7CometSupport
extends AsynchronousProcessor

Comet Portable Runtime implementation on top of Tomcat AIO.

Author:
Jeanfrancois Arcand

Field Summary
static String COMET_EVENT
           
 
Fields inherited from class org.atmosphere.cpr.AsynchronousProcessor
cancelledAction, config, timedoutAction
 
Constructor Summary
Tomcat7CometSupport(AtmosphereConfig config)
           
 
Method Summary
 void action(AtmosphereResourceImpl r)
          Process an Action from an ActionEvent operation like suspend, resume or timed out.
 Action cancelled(AtmosphereRequest req, AtmosphereResponse res)
          All proprietary Comet based Servlet must invoke the cancelled method when the underlying WebServer detect that the client closed the connection.
 AsyncSupport complete(AtmosphereResourceImpl r)
          Complete and close the connection associated with an implementation of AtmosphereResource
 Action service(AtmosphereRequest req, AtmosphereResponse res)
          Invoked by the Tomcat AIO when a Comet request gets detected.
 
Methods inherited from class org.atmosphere.cpr.AsynchronousProcessor
allowSessionTimeoutRemoval, completeLifecycle, endRequest, getContainerName, init, invokeAtmosphereHandler, invokeInterceptors, map, postInterceptors, resumed, shutdown, supportSession, supportWebSocket, suspended, timedout
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMET_EVENT

public static final String COMET_EVENT
See Also:
Constant Field Values
Constructor Detail

Tomcat7CometSupport

public Tomcat7CometSupport(AtmosphereConfig config)
Method Detail

service

public Action service(AtmosphereRequest req,
                      AtmosphereResponse res)
               throws IOException,
                      javax.servlet.ServletException
Invoked by the Tomcat AIO when a Comet request gets detected.

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

action

public void action(AtmosphereResourceImpl r)
Description copied from interface: AsyncSupport
Process an Action from an ActionEvent operation like suspend, resume or timed out.

Specified by:
action in interface AsyncSupport<AtmosphereResourceImpl>
Overrides:
action in class AsynchronousProcessor
Parameters:
r - An instance of Action

complete

public AsyncSupport complete(AtmosphereResourceImpl r)
Description copied from interface: AsyncSupport
Complete and close the connection associated with an implementation of AtmosphereResource

Specified by:
complete in interface AsyncSupport<AtmosphereResourceImpl>
Overrides:
complete in class AsynchronousProcessor
Parameters:
r - AtmosphereResource
Returns:
this

cancelled

public Action cancelled(AtmosphereRequest req,
                        AtmosphereResponse res)
                 throws IOException,
                        javax.servlet.ServletException
Description copied from class: AsynchronousProcessor
All proprietary Comet based Servlet must invoke the cancelled method when the underlying WebServer detect that the client closed the connection.

Overrides:
cancelled in class AsynchronousProcessor
Parameters:
req - the AtmosphereRequest
res - the AtmosphereResponse
Returns:
action the Action operation.
Throws:
IOException
javax.servlet.ServletException


Copyright © 2014. All Rights Reserved.