org.atmosphere.container
Class Servlet30CometSupport

java.lang.Object
  extended by org.atmosphere.cpr.AsynchronousProcessor
      extended by org.atmosphere.container.Servlet30CometSupport
All Implemented Interfaces:
AsyncSupport<AtmosphereResourceImpl>
Direct Known Subclasses:
GlassFishServ30WebSocketSupport, GlassFishServlet30WebSocketSupport, GrizzlyServlet30WebSocketSupport, Jetty9AsyncSupportWithWebSocket, JettyServlet30AsyncSupportWithWebSocket, JSR356AsyncSupport, Tomcat7Servlet30SupportWithWebSocket, WebLogicServlet30WithWebSocket

public class Servlet30CometSupport
extends AsynchronousProcessor

This class is used when the AtmosphereFramework detect the container detect Servlet 3.0 Asynch API.

Author:
Jeanfrancois Arcand

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
cancelledAction, config, timedoutAction
 
Constructor Summary
Servlet30CometSupport(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
 void endAsyncContext(AtmosphereRequest request)
           
 String getContainerName()
          Return "javax.servlet".
 Action service(AtmosphereRequest request, AtmosphereResponse response)
          Serve the AtmosphereRequest and the AtmosphereResponse and return the appropriate Action.
 
Methods inherited from class org.atmosphere.cpr.AsynchronousProcessor
allowSessionTimeoutRemoval, completeLifecycle, init, invokeAtmosphereHandler, map, resumed, shutdown, supportSession, supportWebSocket, suspended, timedout
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Servlet30CometSupport

public Servlet30CometSupport(AtmosphereConfig config)
Method Detail

getContainerName

public String getContainerName()
Return "javax.servlet".

Specified by:
getContainerName in interface AsyncSupport<AtmosphereResourceImpl>
Overrides:
getContainerName in class AsynchronousProcessor
Returns:
"javax.servlet"

service

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

Parameters:
request - the AtmosphereRequest
response - 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

endAsyncContext

public void endAsyncContext(AtmosphereRequest request)

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.