org.atmosphere.container
Class GlassFishv2CometSupport

java.lang.Object
  extended by org.atmosphere.cpr.AsynchronousProcessor
      extended by org.atmosphere.container.GlassFishv2CometSupport
All Implemented Interfaces:
CometSupport<AtmosphereResourceImpl>

public class GlassFishv2CometSupport
extends AsynchronousProcessor
implements CometSupport<AtmosphereResourceImpl>

Comet Portable Runtime implementation on top of Grizzly API included with GlassFish v2.

Author:
Jeanfrancois Arcand

Field Summary
 
Fields inherited from class org.atmosphere.cpr.AsynchronousProcessor
aliveRequests, logger, RESOURCE_EVENT, SUPPORT_SESSION
 
Constructor Summary
GlassFishv2CometSupport(AtmosphereServlet.AtmosphereConfig config)
           
 
Method Summary
 void action(AtmosphereResourceImpl actionEvent)
          Process an AtmosphereServlet.Action from an ActionEvent operation like suspend, resume or timed out.
 void init(ServletConfig sc)
          Init Grizzly's CometContext that will be used to suspend and resume the response.
 AtmosphereServlet.Action service(HttpServletRequest req, HttpServletResponse res)
          Serve the HttpServletRequest and the HttpServletResponse and return the appropriate AtmosphereServlet.Action.
 
Methods inherited from class org.atmosphere.cpr.AsynchronousProcessor
cancelled, getContainerName, resumed, 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.cpr.CometSupport
getContainerName
 

Constructor Detail

GlassFishv2CometSupport

public GlassFishv2CometSupport(AtmosphereServlet.AtmosphereConfig config)
Method Detail

init

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

Specified by:
init in interface CometSupport<AtmosphereResourceImpl>
Overrides:
init in class AsynchronousProcessor
Parameters:
sc - the ServletContext
Throws:
ServletException

service

public AtmosphereServlet.Action service(HttpServletRequest req,
                                        HttpServletResponse res)
                                 throws IOException,
                                        ServletException
Serve the HttpServletRequest and the HttpServletResponse and return the appropriate AtmosphereServlet.Action.

Specified by:
service in interface CometSupport<AtmosphereResourceImpl>
Parameters:
req - the HttpServletRequest
res - the HttpServletResponse
Returns:
the AtmosphereServlet.Action that was manipulated by the AtmosphereHandler
Throws:
IOException
ServletException

action

public void action(AtmosphereResourceImpl actionEvent)
Process an AtmosphereServlet.Action from an ActionEvent operation like suspend, resume or timed out.

Specified by:
action in interface CometSupport<AtmosphereResourceImpl>
Overrides:
action in class AsynchronousProcessor
Parameters:
actionEvent - An instance of AtmosphereServlet.Action


Copyright © 2010 SUN Microsystems. All Rights Reserved.