org.atmosphere.container
Class GrizzlyCometSupport

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

public class GrizzlyCometSupport
extends AsynchronousProcessor

Comet Portable Runtime implementation on top of Grizzly 1.5 and up.

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
aliveRequests, cancelledAction, config, timedoutAction
 
Constructor Summary
GrizzlyCometSupport(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.
 void init(javax.servlet.ServletConfig sc)
          Init Grizzly's CometContext that will be used to suspend and resume the response.
 Action service(AtmosphereRequest req, AtmosphereResponse res)
          Serve the AtmosphereRequest and the AtmosphereResponse and return the appropriate Action.
 
Methods inherited from class org.atmosphere.cpr.AsynchronousProcessor
destroyResource, getContainerName, map, 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

GrizzlyCometSupport

public GrizzlyCometSupport(AtmosphereConfig config)
Method Detail

init

public void init(javax.servlet.ServletConfig sc)
          throws javax.servlet.ServletException
Init Grizzly's CometContext that will be used to suspend and resume the response.

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

service

public 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

public void action(AtmosphereResourceImpl r)
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

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 © 2012. All Rights Reserved.